You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -34,20 +42,40 @@ var deleteClusterCmd = &cobra.Command{
34
42
Short: "Delete kubernetes cluster",
35
43
Long: `Delete a kubernetes cluster with one command`,
36
44
Run: func(cmd*cobra.Command, args []string) {
37
-
ifdo.ClusterName=="" {
38
-
exitWithHelp(cmd, "Please provide cluster name.")
39
-
}
40
45
iferr:=RunDelete(); err!=nil {
41
46
glog.Exit(err)
42
47
}
43
48
},
44
49
}
45
50
46
51
funcinit() {
52
+
deleteClusterCmd.Flags().StringVarP(&do.KubeconfigPath, "kubeconfig", "", "", "Path to the kubeconfig file to use for connecting to the cluster to be deleted, if empty, the default KUBECONFIG load path is used.")
47
53
deleteClusterCmd.Flags().StringVarP(&do.ProviderComponents, "provider-components", "p", "", "A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store.")
54
+
// BindContextFlags will bind the flags cluster, namespace, and user
// NewCoreClientSetForDefaultSearchPath creates a core kubernetes clientset. If the kubeconfigPath is specified then the configuration is loaded from that path.
31
36
// Otherwise the default kubeconfig search path is used.
@@ -48,8 +54,9 @@ func NewCoreClientSetForKubeconfig(kubeconfig string) (*kubernetes.Clientset, er
48
54
49
55
// NewClusterApiClientForDefaultSearchPath creates a Cluster API clientset. If the kubeconfigPath is specified then the configuration is loaded from that path.
50
56
// Otherwise the default kubeconfig search path is used.
// newRestConfigForDefaultSearchPath creates a rest.Config by searching for the kubeconfig on the default search path. If an override 'kubeconfigPath' is
106
105
// given then that path is used instead of the default path. If no override is given, an attempt is made to load the
107
106
// 'in cluster' config. If this fails, then the default search path is used.
// newApiConfigForDefaultSearchPath creates an api.Config by searching for the kubeconfig on the default search path. If an override 'kubeconfigPath' is
0 commit comments