Skip to content

Commit

Permalink
Don't close error channel early when wait flag is used (#7217)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiberiuGC authored Oct 24, 2023
1 parent 72605fb commit 5091f93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/actions/addon/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,14 @@ type deleteAddonIAMTask struct {
func (t *deleteAddonIAMTask) Describe() string { return t.info }

func (t *deleteAddonIAMTask) Do(errorCh chan error) error {
defer close(errorCh)

errMsg := fmt.Sprintf("deleting addon IAM %q", *t.stack.StackName)
if t.wait {
if err := t.stackManager.DeleteStackBySpecSync(t.ctx, t.stack, errorCh); err != nil {
return fmt.Errorf("%s: %w", errMsg, err)
}
return nil
}
defer close(errorCh)
if _, err := t.stackManager.DeleteStackBySpec(t.ctx, t.stack); err != nil {
return fmt.Errorf("%s: %w", errMsg, err)
}
Expand Down

0 comments on commit 5091f93

Please sign in to comment.