mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-04-11 11:41:53 +02:00
(chore): Improve log statements about secret ID expiration (#5266)
* Improve log statements about secret ID expiration * Improve log statements about secret ID expiration --------- Co-authored-by: Ivan Nikiforov <ivan.nikiforov@sap.com>
This commit is contained in:
parent
03c9c52887
commit
15bf4da96e
@ -83,12 +83,17 @@ func runVaultRotateSecretID(utils vaultRotateSecretIDUtils) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Entry().Infof("Your secret ID is about to expire in %.0f", ttl.Round(time.Hour*24).Hours()/24)
|
||||
if ttl == 0 {
|
||||
log.Entry().Warn("Secret ID expired")
|
||||
} else {
|
||||
log.Entry().Infof("Your secret ID is about to expire in %.0f days", ttl.Round(time.Hour*24).Hours()/24)
|
||||
}
|
||||
|
||||
if ttl > time.Duration(config.DaysBeforeExpiry)*24*time.Hour {
|
||||
log.Entry().Info("Secret ID TTL valid.")
|
||||
return nil
|
||||
}
|
||||
log.Entry().Info("Rotating...")
|
||||
log.Entry().Info("Rotating secret ID...")
|
||||
|
||||
newSecretID, err := utils.GenerateNewAppRoleSecret(GeneralConfig.VaultRoleSecretID, roleName)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user