Skip to content

Commit

Permalink
Improve nodegroup deletion error handling
Browse files Browse the repository at this point in the history
- fix missing return on nodegroup deletion error causing false-positive
- ensure describe stack is called with StackId whenever possible, to avoid
  error on stacks that happen to get deleted already
  • Loading branch information
errordeveloper committed Jan 6, 2019
1 parent 3651823 commit a7553b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/cfn/manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ func (c *StackCollection) describeStack(i *Stack) (*Stack, error) {
input := &cloudformation.DescribeStacksInput{
StackName: i.StackName,
}
if i.StackId != nil && *i.StackId != "" {
input.StackName = i.StackId
}
if i.StackId != nil {
input.StackName = i.StackId
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/delete/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func doDeleteCluster(p *api.ProviderConfig, cfg *api.ClusterConfig, nameArg stri
for _, err := range errs {
logger.Critical("%s\n", err.Error())
}
handleIfError(fmt.Errorf("failed to delete nodegroup(s)"), "nodegroup(s)")
return fmt.Errorf("failed to delete nodegroup(s)")
}
logger.Debug("all nodegroups were deleted")
}
Expand Down

0 comments on commit a7553b3

Please sign in to comment.