@@ -116,20 +116,21 @@ func (d *Deleter) DeleteTasks(ctx context.Context, podIDs []Identifier) (*tasks.
116
116
return taskTree , nil
117
117
}
118
118
119
- for _ , p := range podIDs {
119
+ for _ , podID := range podIDs {
120
+ podID := podID
120
121
piaDeletionTasks := & tasks.TaskTree {
121
122
Parallel : false ,
122
123
IsSubTask : true ,
123
124
}
124
- piaDeletionTasks .Append (d .makeDeleteTask (ctx , p , roleStackNames ))
125
+ piaDeletionTasks .Append (d .makeDeleteTask (ctx , podID , roleStackNames ))
125
126
piaDeletionTasks .Append (& tasks.GenericTask {
126
- Description : fmt .Sprintf ("delete service account %q" , p .IDString ()),
127
+ Description : fmt .Sprintf ("delete service account %q" , podID .IDString ()),
127
128
Doer : func () error {
128
129
if err := kubernetes .MaybeDeleteServiceAccount (d .ClientSet , v1.ObjectMeta {
129
- Name : p .ServiceAccountName ,
130
- Namespace : p .Namespace ,
130
+ Name : podID .ServiceAccountName ,
131
+ Namespace : podID .Namespace ,
131
132
}); err != nil {
132
- return fmt .Errorf ("failed to delete service account %q: %w" , p .IDString (), err )
133
+ return fmt .Errorf ("failed to delete service account %q: %w" , podID .IDString (), err )
133
134
}
134
135
return nil
135
136
},
0 commit comments