Skip to content

Commit

Permalink
Fix double error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Feb 1, 2021
1 parent 6e09363 commit c9bebde
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmd/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ var destroyRegionCmd = &cobra.Command{
cfnSvc := cloudformation.New(sess)
friendlyName := fmt.Sprintf("region %s", *sess.Config.Region)
stack, err := confirmDeleteStack(cfnSvc, stackName, friendlyName)
err = deleteStack(cfnSvc, *stack.StackId, friendlyName, false)
_, err1 := ssmSvc.DeleteParameter(&ssm.DeleteParameterInput{
_, err = ssmSvc.DeleteParameter(&ssm.DeleteParameterInput{
Name: aws.String("/apppack/account/dockerhub-access-token"),
})
if err != nil {
printError(fmt.Sprintf("%v", err))
}
err = deleteStack(cfnSvc, *stack.StackId, friendlyName, false)
checkErr(err)
checkErr(err1)
},
}

Expand All @@ -159,11 +161,13 @@ var destroyRedisCmd = &cobra.Command{
friendlyName := fmt.Sprintf("app %s", args[0])
stack, err := confirmDeleteStack(cfnSvc, stackName, friendlyName)
err = deleteStack(cfnSvc, *stack.StackId, friendlyName, false)
_, err1 := ssmSvc.DeleteParameter(&ssm.DeleteParameterInput{
if err != nil {
printError(fmt.Sprintf("%v", err))
}
_, err = ssmSvc.DeleteParameter(&ssm.DeleteParameterInput{
Name: aws.String(fmt.Sprintf(redisAuthTokenParameterTmpl, args[0])),
})
checkErr(err)
checkErr(err1)
},
}

Expand Down

0 comments on commit c9bebde

Please sign in to comment.