diff --git a/cmd/cluster_create.go b/cmd/cluster_create.go index 8a43573..5b114ca 100644 --- a/cmd/cluster_create.go +++ b/cmd/cluster_create.go @@ -95,6 +95,7 @@ tks cluster create `, fmt.Println("Response:\n", r) if err != nil { fmt.Println("Error:", err) + os.Exit(1) } else { fmt.Println("Success: The request to create cluster ", args[0], " was accepted.") } diff --git a/cmd/cluster_delete.go b/cmd/cluster_delete.go index cf8190c..68b6f32 100644 --- a/cmd/cluster_delete.go +++ b/cmd/cluster_delete.go @@ -76,6 +76,7 @@ tks cluster delete `, fmt.Println(r) if err != nil { fmt.Println(err) + os.Exit(1) } else { fmt.Println("The request to delete cluster ", args[0], " was accepted.") } diff --git a/cmd/cluster_list.go b/cmd/cluster_list.go index 6847c44..df8a685 100644 --- a/cmd/cluster_list.go +++ b/cmd/cluster_list.go @@ -73,6 +73,7 @@ tks cluster list (--long)`, r, err := client.GetClusters(ctx, &data) if err != nil { fmt.Println(err) + os.Exit(1) } else { if len(r.Clusters) == 0 { fmt.Println("No cluster exists for specified contract!") diff --git a/cmd/cluster_show.go b/cmd/cluster_show.go index 38141ef..d264040 100644 --- a/cmd/cluster_show.go +++ b/cmd/cluster_show.go @@ -75,6 +75,7 @@ tks cluster show `, r, err := client.GetCluster(ctx, &data) if err != nil { fmt.Println(err) + os.Exit(1) } else { printCluster(r) } diff --git a/cmd/service_create.go b/cmd/service_create.go index 78f3c0c..120188c 100644 --- a/cmd/service_create.go +++ b/cmd/service_create.go @@ -100,6 +100,7 @@ tks service create --cluster-id --service-name `, r, err := client.UninstallAppGroups(ctx, &data) if err != nil { fmt.Println(err) + os.Exit(1) } else { fmt.Println(r) } diff --git a/cmd/service_list.go b/cmd/service_list.go index c359389..2a7243f 100644 --- a/cmd/service_list.go +++ b/cmd/service_list.go @@ -79,6 +79,7 @@ tks service list (--long)`, r, err := client.GetAppGroupsByClusterID(ctx, &data) if err != nil { fmt.Println(err) + os.Exit(1) } else { long, _ := cmd.Flags().GetBool("long") printAppGroups(r, long)