Skip to content

Commit

Permalink
Check if we have at least one Pod
Browse files Browse the repository at this point in the history
  • Loading branch information
johscheuer committed Mar 23, 2022
1 parent 9a613e6 commit cb1e9bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kubectl-fdb/cmd/exclusion_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package cmd

import (
"encoding/json"
"fmt"
"sort"
"time"

Expand Down Expand Up @@ -81,6 +82,10 @@ func newExclusionStatusCmd(streams genericclioptions.IOStreams) *cobra.Command {
return err
}

if len(pods.Items) == 0 {
return fmt.Errorf("no running Pods are found for cluster: %s/%s", cluster.Namespace, cluster.Name)
}

// TODO get the pod randomly
err = getExclusionStatus(cmd, config, clientSet, pods.Items[0].Name, namespace, ignoreFullyExcluded, interval)
if err != nil {
Expand Down

0 comments on commit cb1e9bc

Please sign in to comment.