From 9cfb8f1277bfbf258532553e7dfe752857a33974 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 9 Oct 2023 15:48:22 +0200 Subject: [PATCH] misc: fix hypothetical implicit memory aliasing Signed-off-by: Hidde Beydals --- internal/controller/helmchart_controller.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/controller/helmchart_controller.go b/internal/controller/helmchart_controller.go index 556253efe..1f952847f 100644 --- a/internal/controller/helmchart_controller.go +++ b/internal/controller/helmchart_controller.go @@ -1129,9 +1129,9 @@ func (r *HelmChartReconciler) requestsForHelmRepositoryChange(ctx context.Contex } var reqs []reconcile.Request - for _, i := range list.Items { - if i.Status.ObservedSourceArtifactRevision != repo.GetArtifact().Revision { - reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) + for i, v := range list.Items { + if v.Status.ObservedSourceArtifactRevision != repo.GetArtifact().Revision { + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&list.Items[i])}) } } return reqs @@ -1159,9 +1159,9 @@ func (r *HelmChartReconciler) requestsForGitRepositoryChange(ctx context.Context } var reqs []reconcile.Request - for _, i := range list.Items { - if !repo.GetArtifact().HasRevision(i.Status.ObservedSourceArtifactRevision) { - reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) + for i, v := range list.Items { + if !repo.GetArtifact().HasRevision(v.Status.ObservedSourceArtifactRevision) { + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&list.Items[i])}) } } return reqs @@ -1189,9 +1189,9 @@ func (r *HelmChartReconciler) requestsForBucketChange(ctx context.Context, o cli } var reqs []reconcile.Request - for _, i := range list.Items { - if !bucket.GetArtifact().HasRevision(i.Status.ObservedSourceArtifactRevision) { - reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) + for i, v := range list.Items { + if !bucket.GetArtifact().HasRevision(v.Status.ObservedSourceArtifactRevision) { + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&list.Items[i])}) } } return reqs