Skip to content

Commit c5358b5

Browse files
committed
Merge branch 'master' into bugfix/enforce-anti-affinity
2 parents c017ba7 + 9af8683 commit c5358b5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/deployment/reconcile/plan_builder.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,21 @@ func podNeedsRotation(p v1.Pod, apiObject metav1.Object, spec api.DeploymentSpec
289289
}*/
290290

291291
// Check service account
292-
if p.Spec.ServiceAccountName != groupSpec.GetServiceAccountName() {
292+
if normalizeServiceAccountName(p.Spec.ServiceAccountName) != normalizeServiceAccountName(groupSpec.GetServiceAccountName()) {
293293
return true, "ServiceAccountName changed"
294294
}
295295

296296
return false, ""
297297
}
298298

299+
// normalizeServiceAccountName replaces default with empty string, otherwise returns the input.
300+
func normalizeServiceAccountName(name string) string {
301+
if name == "default" {
302+
return ""
303+
}
304+
return ""
305+
}
306+
299307
// tlsKeyfileNeedsRenewal decides if the certificate in the given keyfile
300308
// should be renewed.
301309
func tlsKeyfileNeedsRenewal(log zerolog.Logger, keyfile string) bool {
@@ -374,6 +382,7 @@ func createRotateMemberPlan(log zerolog.Logger, member api.MemberStatus,
374382
log.Debug().
375383
Str("id", member.ID).
376384
Str("role", group.AsRole()).
385+
Str("reason", reason).
377386
Msg("Creating rotation plan")
378387
plan := api.Plan{
379388
api.NewAction(api.ActionTypeRotateMember, group, member.ID, reason),
@@ -389,6 +398,7 @@ func createUpgradeMemberPlan(log zerolog.Logger, member api.MemberStatus,
389398
log.Debug().
390399
Str("id", member.ID).
391400
Str("role", group.AsRole()).
401+
Str("reason", reason).
392402
Msg("Creating upgrade plan")
393403
plan := api.Plan{
394404
api.NewAction(api.ActionTypeUpgradeMember, group, member.ID, reason),

0 commit comments

Comments
 (0)