Skip to content

Commit

Permalink
change to ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan committed Oct 30, 2024
1 parent a09ce3f commit e8a761d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/collect/run_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *CollectRunPod) Collect(progressChan chan<- interface{}) (result Collect
if c.Collector.ImagePullSecret != nil && c.Collector.ImagePullSecret.Data != nil {
defer func() {
if c.Collector.ImagePullSecret.Name != "" {
if err := client.CoreV1().Secrets(pod.Namespace).Delete(context.Background(), c.Collector.ImagePullSecret.Name, metav1.DeleteOptions{}); err != nil {
if err := client.CoreV1().Secrets(pod.Namespace).Delete(ctx, c.Collector.ImagePullSecret.Name, metav1.DeleteOptions{}); err != nil {
klog.Errorf("Failed to delete secret %s: %v", c.Collector.ImagePullSecret.Name, err)
}
}
Expand Down

0 comments on commit e8a761d

Please sign in to comment.