Skip to content

Commit

Permalink
Update after review
Browse files Browse the repository at this point in the history
Review comments:
- helm#132 (comment)
- helm#132 (comment)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
  • Loading branch information
hickeyma committed Mar 12, 2020
1 parent 3f8f18e commit 5c31cb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Flags:
--kube-context string name of the kubeconfig context to use
--kubeconfig string path to the kubeconfig file
-l, --label string label to select Tiller resources by (default "OWNER=TILLER")
-n, --name string the release name. When it is specified, the named release and its versions will be removed only. Should not be used with other cleanup operations
--name string the release name. When it is specified, the named release and its versions will be removed only. Should not be used with other cleanup operations
--release-cleanup if set, release data cleanup performed
-s, --release-storage string v2 release storage type/object. It can be 'secrets' or 'configmaps'. This is only used with the 'tiller-out-cluster' flag (default "secrets")
--tiller-cleanup if set, Tiller cleanup performed
Expand Down
10 changes: 7 additions & 3 deletions cmd/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func newCleanupCmd(out io.Writer) *cobra.Command {
settings.AddFlags(flags)

flags.BoolVar(&configCleanup, "config-cleanup", false, "if set, configuration cleanup performed")
flags.StringVarP(&releaseName, "name", "n", "", "the release name. When it is specified, the named release and its versions will be removed only. Should not be used with other cleanup operations")
flags.StringVar(&releaseName, "name", "", "the release name. When it is specified, the named release and its versions will be removed only. Should not be used with other cleanup operations")
flags.BoolVar(&releaseCleanup, "release-cleanup", false, "if set, release data cleanup performed")
flags.BoolVar(&tillerCleanup, "tiller-cleanup", false, "if set, Tiller cleanup performed")

Expand Down Expand Up @@ -121,10 +121,14 @@ func Cleanup(cleanupOptions CleanupOptions, kubeConfig common.KubeConfig) error
fmt.Fprint(&message, "\"Helm v2 Configuration\" ")
}
if cleanupOptions.ReleaseCleanup {
fmt.Fprint(&message, "\"Release Data\" ")
if cleanupOptions.ReleaseName == "" {
fmt.Fprint(&message, "\"Release Data\" ")
} else {
fmt.Fprint(&message, fmt.Sprintf("\"Release '%s' Data\" ", cleanupOptions.ReleaseName))
}
}
if cleanupOptions.TillerCleanup {
fmt.Fprint(&message, "\"Release Data\" ")
fmt.Fprint(&message, "\"Tiller\" ")
}
fmt.Fprintln(&message, "will be removed. ")
if cleanupOptions.ReleaseCleanup && cleanupOptions.ReleaseName == "" {
Expand Down

0 comments on commit 5c31cb2

Please sign in to comment.