From e8a761d5bae401afd7431c0e0bbef61c8cb38acd Mon Sep 17 00:00:00 2001 From: Dexter Yan Date: Wed, 30 Oct 2024 19:11:30 +1300 Subject: [PATCH] change to ctx --- pkg/collect/run_pod.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/collect/run_pod.go b/pkg/collect/run_pod.go index e1d7c7af3..e430d6c99 100644 --- a/pkg/collect/run_pod.go +++ b/pkg/collect/run_pod.go @@ -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) } }