From cbc610ddc55fb85bb552df0e4cfd385f66443003 Mon Sep 17 00:00:00 2001 From: Rob Leidle Date: Tue, 19 Jun 2018 11:09:32 -0700 Subject: [PATCH] Add an optional provider-components flag to `clusterctl delete cluster` (#362) --- clusterctl/cmd/delete_cluster.go | 4 +++- .../testdata/delete-cluster-no-args-invalid-flag.golden | 3 ++- clusterctl/testdata/delete-cluster-no-args.golden | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/clusterctl/cmd/delete_cluster.go b/clusterctl/cmd/delete_cluster.go index f6d46ee426bc..8830bf4e04e7 100644 --- a/clusterctl/cmd/delete_cluster.go +++ b/clusterctl/cmd/delete_cluster.go @@ -23,7 +23,8 @@ import ( ) type DeleteOptions struct { - ClusterName string + ClusterName string + ProviderComponents string } var do = &DeleteOptions{} @@ -43,6 +44,7 @@ var deleteClusterCmd = &cobra.Command{ } func init() { + 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.") deleteCmd.AddCommand(deleteClusterCmd) } diff --git a/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden b/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden index d41423ac4325..523c330b86e9 100644 --- a/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden +++ b/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden @@ -3,7 +3,8 @@ Usage: clusterctl delete cluster [flags] Flags: - -h, --help help for cluster + -h, --help help for cluster + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. Global Flags: --alsologtostderr log to standard error as well as files diff --git a/clusterctl/testdata/delete-cluster-no-args.golden b/clusterctl/testdata/delete-cluster-no-args.golden index e333eb7191ed..dbdce3ba3168 100644 --- a/clusterctl/testdata/delete-cluster-no-args.golden +++ b/clusterctl/testdata/delete-cluster-no-args.golden @@ -5,7 +5,8 @@ Usage: clusterctl delete cluster [flags] Flags: - -h, --help help for cluster + -h, --help help for cluster + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. Global Flags: --alsologtostderr log to standard error as well as files