Skip to content

Commit

Permalink
Fix deleted info storing with both --wait and --interactive (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
micnncim committed Sep 20, 2020
1 parent c4038f7 commit 81497eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ func (o *Options) Run(ctx context.Context, f cmdutil.Factory) error {
return nil // skip deletion
}

deletedInfos = append(deletedInfos, info)

if o.interactive {
kind := info.Object.GetObjectKind().GroupVersionKind().Kind
if ok := prompt.Confirm(fmt.Sprintf("Are you sure to delete %s/%s?", strings.ToLower(kind), info.Name)); !ok {
return nil // skip deletion
}
}

deletedInfos = append(deletedInfos, info)

if o.dryRunStrategy == cmdutil.DryRunClient && !o.quiet {
o.printObj(info.Object)
return nil // skip deletion
Expand Down

0 comments on commit 81497eb

Please sign in to comment.