Skip to content

Commit

Permalink
check if the service provides selectors (derailed#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjiec committed Dec 1, 2023
1 parent bb0860e commit 916cad0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/view/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ func (s *Service) showPods(a *App, _ ui.Tabular, gvr, path string) {
a.Flash().Warnf("No matching pods. Service %s is an external service.", path)
return
}
if svc.Spec.Selector == nil {
a.Flash().Warnf("No matching pods. Service %s does not provide any selectors", path)
return
}

showPodsWithLabels(a, path, svc.Spec.Selector)
}
Expand Down

0 comments on commit 916cad0

Please sign in to comment.