diff --git a/cmd/gather/cluster/cluster.go b/cmd/gather/cluster/cluster.go index 3d289fb6ae..2f1e05b1d4 100644 --- a/cmd/gather/cluster/cluster.go +++ b/cmd/gather/cluster/cluster.go @@ -16,6 +16,7 @@ package cluster import ( "context" + "errors" "fmt" "log" "os" @@ -104,6 +105,10 @@ func (c *Cluster) GetOperatorLogs() error { return err } + if len(operatorPods.Items) == 0 { + return errors.New("no operator pods found") + } + pod := operatorPods.Items[0] c.getPodLogs(pod.Name, pod.Namespace, "manager") return nil