Skip to content

Commit

Permalink
remove err sentinel
Browse files Browse the repository at this point in the history
  • Loading branch information
wjiec committed Nov 10, 2023
1 parent 1e424a7 commit d219546
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/view/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,6 @@ func podIsRunning(f dao.Factory, path string) bool {
return re.Phase(po) == render.Running
}

var (
ErrNoOSInfoFound = errors.New("no os information available")
)

func getPodOS(f dao.Factory, fqn string) (string, error) {
po, err := fetchPod(f, fqn)
if err != nil {
Expand All @@ -500,7 +496,7 @@ func getPodOS(f dao.Factory, fqn string) (string, error) {
return podOS, nil
}
if len(po.Spec.NodeName) == 0 {
return "", ErrNoOSInfoFound
return "", errors.New("no os information available")
}

node, err := dao.FetchNode(context.Background(), f, po.Spec.NodeName)
Expand All @@ -510,7 +506,7 @@ func getPodOS(f dao.Factory, fqn string) (string, error) {
if nodeOS, ok := osFromSelector(node.Labels); ok {
return nodeOS, nil
}
return "", ErrNoOSInfoFound
return "", errors.New("no os information available")
}

func osFromSelector(m map[string]string) (string, bool) {
Expand Down

0 comments on commit d219546

Please sign in to comment.