From 7aaf27dba01075635d226f259f1117ead29a24c6 Mon Sep 17 00:00:00 2001 From: i065450 Date: Wed, 18 Dec 2024 13:14:12 +0200 Subject: [PATCH] [SAPBTPCFS-15469] Update Service Instance on change of 'parametersFrom' secret --- controllers/serviceinstance_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/serviceinstance_controller.go b/controllers/serviceinstance_controller.go index 36d78768..7a62ee60 100644 --- a/controllers/serviceinstance_controller.go +++ b/controllers/serviceinstance_controller.go @@ -567,10 +567,10 @@ func (r *ServiceInstanceReconciler) buildSMRequestParameters(ctx context.Context //sync instance labels for key, value := range serviceInstance.Labels { if strings.HasPrefix(key, common.InstanceSecretRefLabel) { - if secretName, ok := instanceLabels[key]; !ok { + if _, ok := instanceLabels[key]; !ok { instanceLabelsChanged = true - if err := utils.RemoveWatchForSecret(ctx, r.Client, types.NamespacedName{Name: secretName, Namespace: serviceInstance.Namespace}, string(serviceInstance.UID)); err != nil { - log.Error(err, fmt.Sprintf("failed to unwatch secret %s", secretName)) + if err := utils.RemoveWatchForSecret(ctx, r.Client, types.NamespacedName{Name: value, Namespace: serviceInstance.Namespace}, string(serviceInstance.UID)); err != nil { + log.Error(err, fmt.Sprintf("failed to unwatch secret %s", value)) return nil, err } }