Skip to content

Commit

Permalink
handle nil ImagePullSecret in collector (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Sep 9, 2020
1 parent e232cc0 commit b2cb3bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/collect/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Run(c *Collector, runCollector *troubleshootv1beta2.Run) (map[string][]byte
logger.Printf("Failed to delete pod %s: %v\n", pod.Name, err)
}
}()
if runCollector.ImagePullSecret.Data != nil {
if runCollector.ImagePullSecret != nil && runCollector.ImagePullSecret.Data != nil {
defer func() {
for _, k := range pod.Spec.ImagePullSecrets {
if err := client.CoreV1().Secrets(pod.Namespace).Delete(ctx, k.Name, metav1.DeleteOptions{}); err != nil {
Expand Down

0 comments on commit b2cb3bf

Please sign in to comment.