Skip to content

Commit b17d037

Browse files
committed
Fix creating pod identities
Replaces usage of a per-loop variable with a per-iteration variable.
1 parent dfd89d8 commit b17d037

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/actions/podidentityassociation/creator.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ func (c *Creator) CreateTasks(ctx context.Context, podIdentityAssociations []api
4545
taskTree := &tasks.TaskTree{
4646
Parallel: true,
4747
}
48-
for i, pia := range podIdentityAssociations {
48+
for _, pia := range podIdentityAssociations {
49+
pia := pia
4950
piaCreationTasks := &tasks.TaskTree{
5051
Parallel: false,
5152
IsSubTask: true,
@@ -55,7 +56,7 @@ func (c *Creator) CreateTasks(ctx context.Context, podIdentityAssociations []api
5556
ctx: ctx,
5657
info: fmt.Sprintf("create IAM role for pod identity association for service account %q", pia.NameString()),
5758
clusterName: c.clusterName,
58-
podIdentityAssociation: &podIdentityAssociations[i],
59+
podIdentityAssociation: &pia,
5960
stackCreator: c.stackCreator,
6061
})
6162
}
@@ -75,7 +76,7 @@ func (c *Creator) CreateTasks(ctx context.Context, podIdentityAssociations []api
7576
ctx: ctx,
7677
info: fmt.Sprintf("create pod identity association for service account %q", pia.NameString()),
7778
clusterName: c.clusterName,
78-
podIdentityAssociation: &podIdentityAssociations[i],
79+
podIdentityAssociation: &pia,
7980
eksAPI: c.eksAPI,
8081
})
8182
taskTree.Append(piaCreationTasks)

0 commit comments

Comments
 (0)