From 15563c047f6448d67a0c9fe50489176750493367 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Wed, 22 Jan 2025 11:27:39 +0800 Subject: [PATCH] fix: pg restart failed (#8845) --- pkg/controller/instanceset/reconciler_update.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/instanceset/reconciler_update.go b/pkg/controller/instanceset/reconciler_update.go index baee5352317..efea730f60e 100644 --- a/pkg/controller/instanceset/reconciler_update.go +++ b/pkg/controller/instanceset/reconciler_update.go @@ -217,11 +217,11 @@ func (r *updateReconciler) switchover(tree *kubebuilderx.ObjectTree, its *worklo clusterName, err := func() (string, error) { var clusterName string - if its.Annotations != nil { - clusterName = its.Annotations[constant.AppInstanceLabelKey] + if its.Labels != nil { + clusterName = its.Labels[constant.AppInstanceLabelKey] } if len(clusterName) == 0 { - return "", fmt.Errorf("InstanceSet %s/%s has no annotation %s", its.Namespace, its.Name, constant.AppInstanceLabelKey) + return "", fmt.Errorf("InstanceSet %s/%s has no label %s", its.Namespace, its.Name, constant.AppInstanceLabelKey) } return clusterName, nil