From 4767bcf903b7ad7b0af1a7b38dc14e983f18a4df Mon Sep 17 00:00:00 2001 From: matthias Date: Mon, 15 Dec 2025 15:39:58 +0100 Subject: [PATCH] ensure a recreate of sts is trggered if there is a serviceName change --- pkg/cluster/cluster.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index be22ec6c..6b2e3785 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -566,6 +566,11 @@ func (c *Cluster) compareStatefulSetWith(oldSts, newSts *appsv1.StatefulSet) *co needsRollUpdate = true reasons = append(reasons, "new statefulset's serviceAccountName service account name does not match the current one") } + if oldSts.Spec.ServiceName != newSts.Spec.ServiceName { + needsReplace = true + needsRollUpdate = true + reasons = append(reasons, "new statefulset's serviceName does not match the current one") + } if *oldSts.Spec.Template.Spec.TerminationGracePeriodSeconds != *newSts.Spec.Template.Spec.TerminationGracePeriodSeconds { needsReplace = true needsRollUpdate = true