File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -719,6 +719,7 @@ class Config extends EventEmitter {
719719 process . env . S3KMIP_BUCKET_ATTRIBUTE_NAME || '' ,
720720 } ,
721721 transport : this . _parseKmipTransport ( { } ) ,
722+ retries : 0 ,
722723 } ;
723724 if ( config . kmip ) {
724725 assert ( config . kmip . providerName , 'config.kmip.providerName must be defined' ) ;
@@ -743,6 +744,14 @@ class Config extends EventEmitter {
743744 if ( Array . isArray ( config . kmip . transport ) ) {
744745 this . kmip . transport = config . kmip . transport . map ( t =>
745746 this . _parseKmipTransport ( t ) ) ;
747+ if ( config . kmip . retries ) {
748+ assert ( typeof config . kmip . retries === 'number' ,
749+ 'bad config: KMIP Cluster retries must be a number' ) ;
750+ assert ( config . kmip . retries <= this . kmip . transport . length - 1 ,
751+ 'bad config: KMIP Cluster retries must be lower or equal to the number of hosts - 1' ) ;
752+ } else {
753+ this . kmip . retries = this . kmip . transport . length - 1 ;
754+ }
746755 } else {
747756 this . kmip . transport =
748757 this . _parseKmipTransport ( config . kmip . transport ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ const kmsFactory = {
5252 throw new Error ( 'KMIP KMS driver configuration is missing.' ) ;
5353 }
5454 const client = Array . isArray ( config . kmip . transport )
55- ? new KMIPClusterClient ( { kmip : config . kmip } )
55+ ? new KMIPClusterClient ( { kmip : config . kmip , logger , retries : config . kmip . retries } )
5656 : new KMIPClient ( { kmip : config . kmip } ) ;
5757 return { client, implName : 'kmip' } ;
5858 } ,
You can’t perform that action at this time.
0 commit comments