Quick fix to prevent panic on nil collector result (#1508)

* quick fix to prevent panic on nil collector result
* do not save pod details on error
This commit is contained in:
Gerard Nguyen
2024-03-18 16:42:52 +11:00
committed by GitHub
parent ebe98ff2f1
commit 6f839b389d

View File

@@ -72,6 +72,9 @@ func (c *CollectRunPod) Collect(progressChan chan<- interface{}) (result Collect
}
defer func() {
if err != nil {
return
}
result, err = savePodDetails(ctx, client, result, c.BundlePath, c.ClientConfig, pod, c.Collector)
if err != nil {
klog.Errorf("failed to save pod details: %v", err)