Merge pull request #734 from technosophos/fix/687-delete-dry-run

fix(helm): improve --dry-run for helm delete
pull/735/merge
Matt Butcher 9 years ago
commit 9d96b789f1

@ -2,7 +2,6 @@ package main
import (
"errors"
"fmt"
"github.com/kubernetes/helm/pkg/helm"
"github.com/spf13/cobra"
@ -37,13 +36,7 @@ func delRelease(cmd *cobra.Command, args []string) error {
return errors.New("command 'delete' requires a release name")
}
// TODO: Handle dry run use case.
if deleteDryRun {
fmt.Printf("DRY RUN: Deleting %s\n", args[0])
return nil
}
_, err := helm.UninstallRelease(args[0])
_, err := helm.UninstallRelease(args[0], deleteDryRun)
if err != nil {
return prettyError(err)
}

@ -66,7 +66,17 @@ func UpdateRelease(name string) (*services.UpdateReleaseResponse, error) {
}
// UninstallRelease uninstalls a named release and returns the response.
func UninstallRelease(name string) (*services.UninstallReleaseResponse, error) {
func UninstallRelease(name string, dryRun bool) (*services.UninstallReleaseResponse, error) {
if dryRun {
// In the dry run case, just see if the release exists.
res, err := GetReleaseContent(name)
if err != nil {
return &services.UninstallReleaseResponse{}, err
}
return &services.UninstallReleaseResponse{Release: res.Release}, nil
}
u := &services.UninstallReleaseRequest{
Name: name,
}

Loading…
Cancel
Save