Skip to content

Commit

Permalink
util: fix extra linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Raghavendra Talur <[email protected]>
(cherry picked from commit 12d1e9d)
  • Loading branch information
raghavendra-talur authored and ShyamsundarR committed Dec 26, 2024
1 parent bb6c87b commit 085b8c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions internal/controller/util/json_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,18 @@ func getObjectsBasedOnType(objList client.ObjectList) []client.Object {
switch v := objList.(type) {
case *corev1.PodList:
for _, pod := range v.Items {
objs = append(objs, &pod)
podCopy := pod
objs = append(objs, &podCopy)
}
case *appsv1.DeploymentList:
for _, dep := range v.Items {
objs = append(objs, &dep)
depCopy := dep
objs = append(objs, &depCopy)
}
case *appsv1.StatefulSetList:
for _, ss := range v.Items {
objs = append(objs, &ss)
ssCopy := ss
objs = append(objs, &ssCopy)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/util/json_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestEvaluateCheckHookExp(t *testing.T) {
t.Run(strconv.Itoa(i), func(t *testing.T) {
var jsonData map[string]interface{}

err := json.Unmarshal(tt.jsonText, &jsonData)
err := json.Unmarshal(test.jsonText, &jsonData)
if err != nil {
t.Error(err)
}
Expand Down

0 comments on commit 085b8c1

Please sign in to comment.