Don't error out when no kubernetes client is found
This commit is contained in:
parent
7a34fd98d9
commit
85924f6381
@ -41,8 +41,9 @@ func NewRootCmd(out io.Writer, client *kube.Client, args []string) (*cobra.Comma
|
||||
|
||||
// Execute runs the base airshipctl command
|
||||
func Execute(out io.Writer) {
|
||||
client, err := kube.NewForConfig(settings.KubeConfigFilePath)
|
||||
osExitIfError(out, err)
|
||||
// TODO(howell): Fix this unused error
|
||||
client, _ := kube.NewForConfig(settings.KubeConfigFilePath)
|
||||
|
||||
rootCmd, err := NewRootCmd(out, client, os.Args[1:])
|
||||
osExitIfError(out, err)
|
||||
osExitIfError(out, rootCmd.Execute())
|
||||
|
@ -45,6 +45,9 @@ func clientVersion() string {
|
||||
}
|
||||
|
||||
func kubeVersion(client *kube.Client) (string, error) {
|
||||
if client == nil {
|
||||
return "could not connect to a kubernetes cluster", nil
|
||||
}
|
||||
version, err := client.Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
Loading…
x
Reference in New Issue
Block a user