Commit 68653814 authored by Ville Aikas's avatar Ville Aikas

Merge pull request #682 from vaikas-google/master

rename remove to delete
parents 80fe12c3 e35edc74
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
const removeDesc = ` const deleteDesc = `
This command takes a release name, and then deletes the release from Kubernetes. This command takes a release name, and then deletes the release from Kubernetes.
It removes all of the resources associated with the last release of the chart. It removes all of the resources associated with the last release of the chart.
...@@ -16,29 +16,29 @@ Use the '--dry-run' flag to see which releases will be deleted without actually ...@@ -16,29 +16,29 @@ Use the '--dry-run' flag to see which releases will be deleted without actually
deleting them. deleting them.
` `
var removeDryRun bool var deleteDryRun bool
var removeCommand = &cobra.Command{ var deleteCommand = &cobra.Command{
Use: "remove [flags] RELEASE_NAME", Use: "delete [flags] RELEASE_NAME",
Aliases: []string{"rm"}, Aliases: []string{"del"},
SuggestFor: []string{"delete", "del"}, SuggestFor: []string{"remove", "rm"},
Short: "Given a release name, remove the release from Kubernetes", Short: "Given a release name, delete the release from Kubernetes",
Long: removeDesc, Long: deleteDesc,
RunE: rmRelease, RunE: delRelease,
} }
func init() { func init() {
RootCommand.AddCommand(removeCommand) RootCommand.AddCommand(deleteCommand)
removeCommand.Flags().BoolVar(&removeDryRun, "dry-run", false, "Simulate action, but don't actually do it.") deleteCommand.Flags().BoolVar(&deleteDryRun, "dry-run", false, "Simulate action, but don't actually do it.")
} }
func rmRelease(cmd *cobra.Command, args []string) error { func delRelease(cmd *cobra.Command, args []string) error {
if len(args) == 0 { if len(args) == 0 {
return errors.New("Command 'remove' requires a release name.") return errors.New("Command 'delete' requires a release name.")
} }
// TODO: Handle dry run use case. // TODO: Handle dry run use case.
if removeDryRun { if deleteDryRun {
fmt.Printf("DRY RUN: Deleting %s\n", args[0]) fmt.Printf("DRY RUN: Deleting %s\n", args[0])
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment