mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Use GetDuration() helper for MINIO_KMS_KEY_CACHE_INTERVAL as time.Duration (#19512)
Bonus: Use default duration of 10 seconds if invalid input < time.Second is specified
This commit is contained in:
@@ -958,8 +958,7 @@ func handleKMSConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
kmsLogger := Logger{}
|
||||
KMS, err := kms.NewWithConfig(kmsConf, kmsLogger)
|
||||
KMS, err := kms.NewWithConfig(kmsConf, KMSLogger{})
|
||||
if err != nil {
|
||||
logger.Fatal(err, "Unable to initialize a connection to KES as specified by the shell environment")
|
||||
}
|
||||
|
||||
@@ -194,10 +194,15 @@ func kmsLogIf(ctx context.Context, err error, errKind ...interface{}) {
|
||||
logger.LogIf(ctx, "kms", err, errKind...)
|
||||
}
|
||||
|
||||
// Logger permits access to module specific logging
|
||||
type Logger struct{}
|
||||
// KMSLogger permits access to kms module specific logging
|
||||
type KMSLogger struct{}
|
||||
|
||||
// LogOnceIf is the implementation of LogOnceIf, accessible using the Logger interface
|
||||
func (l Logger) LogOnceIf(ctx context.Context, subsystem string, err error, id string, errKind ...interface{}) {
|
||||
logger.LogOnceIf(ctx, subsystem, err, id, errKind...)
|
||||
func (l KMSLogger) LogOnceIf(ctx context.Context, err error, id string, errKind ...interface{}) {
|
||||
logger.LogOnceIf(ctx, "kms", err, id, errKind...)
|
||||
}
|
||||
|
||||
// LogIf is the implementation of LogIf, accessible using the Logger interface
|
||||
func (l KMSLogger) LogIf(ctx context.Context, err error, errKind ...interface{}) {
|
||||
logger.LogIf(ctx, "kms", err, errKind...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user