Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: errors silently ignored when deleting resources #792

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions internal/cmd/base/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,17 @@ func (dc *DeleteCmd) Run(s state.State, cmd *cobra.Command, args []string) error
}
}

if len(actions) > 0 {
// TODO: We do not check when an action fail for a specific resource
jooola marked this conversation as resolved.
Show resolved Hide resolved
if err := s.WaitForActions(cmd, s, actions...); err != nil {
errs = append(errs, err)
for _, result := range results {
if result.Error != nil {
errs = append(errs, result.Error)
} else {
deleted = append(deleted, result.IDOrName)
}
}

for _, result := range results {
if result.Error == nil {
deleted = append(deleted, result.IDOrName)
if len(actions) > 0 {
if err := s.WaitForActions(cmd, s, actions...); err != nil {
errs = append(errs, err)
}
}
}
Expand Down
Loading