do not rotate secrets for standby clusters (#2175)
This commit is contained in:
parent
28cd2f188a
commit
a4f95e97e0
|
|
@ -759,7 +759,7 @@ func (c *Cluster) updateSecret(
|
||||||
|
|
||||||
// globally enabled rotation is only allowed for manifest and bootstrapped roles
|
// globally enabled rotation is only allowed for manifest and bootstrapped roles
|
||||||
allowedRoleTypes := []spec.RoleOrigin{spec.RoleOriginManifest, spec.RoleOriginBootstrap}
|
allowedRoleTypes := []spec.RoleOrigin{spec.RoleOriginManifest, spec.RoleOriginBootstrap}
|
||||||
rotationAllowed := !pwdUser.IsDbOwner && util.SliceContains(allowedRoleTypes, pwdUser.Origin)
|
rotationAllowed := !pwdUser.IsDbOwner && util.SliceContains(allowedRoleTypes, pwdUser.Origin) && c.Spec.StandbyCluster == nil
|
||||||
|
|
||||||
if (c.OpConfig.EnablePasswordRotation && rotationAllowed) || rotationEnabledInManifest {
|
if (c.OpConfig.EnablePasswordRotation && rotationAllowed) || rotationEnabledInManifest {
|
||||||
updateSecretMsg, err = c.rotatePasswordInSecret(secret, secretUsername, pwdUser.Origin, currentTime, retentionUsers)
|
updateSecretMsg, err = c.rotatePasswordInSecret(secret, secretUsername, pwdUser.Origin, currentTime, retentionUsers)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue