From b6b9ca5d86c21752ecfc85e1efbb06dbf05d5df0 Mon Sep 17 00:00:00 2001 From: Shyamsundar Ranganathan Date: Thu, 26 Dec 2024 09:57:13 -0500 Subject: [PATCH] Address linter issues on older goangci linter for backport This commit addresses some further linter issues along the same pattern as the prior commit. These are introduced as the linter version upstream is ahead and these errors are no longer an issue. Signed-off-by: Shyamsundar Ranganathan --- internal/controller/util/json_util.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/controller/util/json_util.go b/internal/controller/util/json_util.go index 965d3a935..88d9ad02f 100644 --- a/internal/controller/util/json_util.go +++ b/internal/controller/util/json_util.go @@ -241,7 +241,8 @@ func getMatchingPods(pList *corev1.PodList, re *regexp.Regexp) []client.Object { for _, pod := range pList.Items { if re.MatchString(pod.Name) { - objs = append(objs, &pod) + podCopy := pod + objs = append(objs, &podCopy) } } @@ -253,7 +254,8 @@ func getMatchingDeployments(dList *appsv1.DeploymentList, re *regexp.Regexp) []c for _, pod := range dList.Items { if re.MatchString(pod.Name) { - objs = append(objs, &pod) + podCopy := pod + objs = append(objs, &podCopy) } } @@ -265,7 +267,8 @@ func getMatchingStatefulSets(ssList *appsv1.StatefulSetList, re *regexp.Regexp) for _, pod := range ssList.Items { if re.MatchString(pod.Name) { - objs = append(objs, &pod) + podCopy := pod + objs = append(objs, &podCopy) } }