File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,7 @@ class Config extends EventEmitter {
605605 process . env . S3KMIP_BUCKET_ATTRIBUTE_NAME || '' ,
606606 } ,
607607 transport : this . _parseKmipTransport ( { } ) ,
608+ retries : 0 ,
608609 } ;
609610 if ( config . kmip ) {
610611 assert ( config . kmip . providerName , 'config.kmip.providerName must be defined' ) ;
@@ -629,6 +630,14 @@ class Config extends EventEmitter {
629630 if ( Array . isArray ( config . kmip . transport ) ) {
630631 this . kmip . transport = config . kmip . transport . map ( t =>
631632 this . _parseKmipTransport ( t ) ) ;
633+ if ( config . kmip . retries ) {
634+ assert ( typeof config . kmip . retries === 'number' ,
635+ 'bad config: KMIP Cluster retries must be a number' ) ;
636+ assert ( config . kmip . retries <= this . kmip . transport . length - 1 ,
637+ 'bad config: KMIP Cluster retries must be lower or equal to the number of hosts - 1' ) ;
638+ } else {
639+ this . kmip . retries = this . kmip . transport . length - 1 ;
640+ }
632641 } else {
633642 this . kmip . transport =
634643 this . _parseKmipTransport ( config . kmip . transport ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ const kmsFactory = {
5353 throw new Error ( 'KMIP KMS driver configuration is missing.' ) ;
5454 }
5555 const client = Array . isArray ( config . kmip . transport )
56- ? new KMIPClusterClient ( { kmip : config . kmip } )
56+ ? new KMIPClusterClient ( { kmip : config . kmip , logger , retries : config . kmip . retries } )
5757 : new KMIPClient ( { kmip : config . kmip } ) ;
5858 return { client, implName : 'kmip' } ;
5959 } ,
You can’t perform that action at this time.
0 commit comments