Skip to content

Commit

Permalink
Merge pull request #6868 from oscr/clusterctl-desc-cluster-error-msg
Browse files Browse the repository at this point in the history
🌱 Improve clusterctl describe cluster error message
  • Loading branch information
k8s-ci-robot authored Jul 8, 2022
2 parents 03f62b1 + 7be761b commit 7b9e12f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/clusterctl/cmd/describe_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/fatih/color"
"github.com/gobuffalo/flect"
"github.com/olekukonko/tablewriter"
"github.com/pkg/errors"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/duration"
Expand Down Expand Up @@ -94,7 +95,12 @@ var describeClusterClusterCmd = &cobra.Command{
# e.g. show the infrastructure machine objects, no matter if the current state is already reported by the machine's Ready condition.
clusterctl describe cluster test-1 --disable-no-echo`),

Args: cobra.ExactArgs(1),
Args: func(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
return errors.New("please specify a cluster name")
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
return runDescribeCluster(args[0])
},
Expand Down

0 comments on commit 7b9e12f

Please sign in to comment.