From 26ab3d2e1075fd0d8b4194da8258dc6ba5e1e9aa Mon Sep 17 00:00:00 2001 From: vpnachev Date: Wed, 28 Jun 2023 14:51:50 +0300 Subject: [PATCH] Fix finding of the linter --- pkg/controller/seed/reconciler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controller/seed/reconciler.go b/pkg/controller/seed/reconciler.go index ad46dfb6..f9bfa022 100644 --- a/pkg/controller/seed/reconciler.go +++ b/pkg/controller/seed/reconciler.go @@ -176,10 +176,11 @@ func (kcr *kubeSystemReconciler) setOwnerReferenceToSecrets(ctx context.Context, ownerRef := metav1.NewControllerRef(&owner, corev1.SchemeGroupVersion.WithKind("Namespace")) ownerRef.BlockOwnerDeletion = pointer.Bool(false) - for _, secret := range secretList.Items { + for _, s := range secretList.Items { + secret := s.DeepCopy() patch := client.StrategicMergeFrom(secret.DeepCopy(), client.MergeFromWithOptimisticLock{}) secret.SetOwnerReferences(kutil.MergeOwnerReferences(secret.GetOwnerReferences(), *ownerRef)) - if err := kcr.client.Patch(ctx, &secret, patch); err != nil { + if err := kcr.client.Patch(ctx, secret, patch); err != nil { return err } }