From ba9ccc6a871729311d16af69ef42fef28b24199d Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 21 Feb 2024 07:10:29 +0800 Subject: [PATCH] fix: sts will restart when use kubectl (#1989) sts will restart when use kubectl Co-authored-by: guozhi.li --- pkg/controller/pools.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controller/pools.go b/pkg/controller/pools.go index 4d8f643daa7..1b366f07dc0 100644 --- a/pkg/controller/pools.go +++ b/pkg/controller/pools.go @@ -72,7 +72,10 @@ func poolSSMatchesSpec(expectedStatefulSet, existingStatefulSet *appsv1.Stateful if !equality.Semantic.DeepEqual(expectedMetadata.Labels, existingStatefulSet.ObjectMeta.Labels) { return false, nil } - expectedAnnotations := expectedMetadata.Annotations + expectedAnnotations := map[string]string{} + for k, v := range expectedMetadata.Annotations { + expectedAnnotations[k] = v + } currentAnnotations := existingStatefulSet.ObjectMeta.Annotations delete(expectedAnnotations, corev1.LastAppliedConfigAnnotation) delete(currentAnnotations, corev1.LastAppliedConfigAnnotation)