Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
vdice and carolynvs committed Aug 4, 2020
1 parent 18f3d9c commit 42f8439
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/porter/bundle.go
Expand Up @@ -295,7 +295,7 @@ For example, the 'debug' driver may be specified, which simply logs the info giv
f.BoolVar(&opts.Delete, "delete", false,
"Delete all records associated with the installation, assuming the uninstall action succeeds")
f.BoolVar(&opts.ForceDelete, "force-delete", false,
"Force delete all records associated with the installation, even if the uninstall action does not succeed")
"UNSAFE. Delete all records associated with the installation, even if uninstall fails. This is intended for cleaning up test data and is not recommended for production environments.")

return cmd
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/porter/installations.go
Expand Up @@ -85,9 +85,9 @@ func buildInstallationDeleteCommand(p *porter.Porter) *cobra.Command {
cmd := cobra.Command{
Use: "delete [INSTALLATION]",
Short: "Delete an installation",
Long: "Deletes an installation, including all claim, result and output records.",
Long: "Deletes all records and outputs associated with an installation",
Example: ` porter installation delete
porter installation delete another-installation
porter installation delete wordpress
porter installation delete --force
`,
PreRunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/porter/delete.go
Expand Up @@ -45,7 +45,7 @@ func (p *Porter) DeleteInstallation(opts DeleteOptions) error {
result, err := p.Claims.ReadLastResult(claim.ID)

if (claim.Action != claims.ActionUninstall || result.Status != claims.StatusSucceeded) && !opts.Force {
return fmt.Errorf("not deleting installation as the last action was not a successful %s; use --force to override", claims.ActionUninstall)
return fmt.Error("It is unsafe to delete an installation when the last action wasn't a successful uninstall. If you are sure it should be deleted, retry the last command with the --force flag.")
}

fmt.Fprintf(p.Out, installationDeleteTmpl, opts.Name)
Expand Down

0 comments on commit 42f8439

Please sign in to comment.