Skip to content

Commit

Permalink
Batch mode error out if no resource being listed (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo authored Jan 31, 2025
1 parent ec548e4 commit d756eb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func BatchImport(ctx context.Context, cfg config.NonInteractiveModeConfig) error
return fmt.Errorf("exporting Resource Mapping file: %v", err)
}

if len(list.NonSkipped()) == 0 {
return fmt.Errorf("no resource found")
}

// Return early if only generating mapping file
if cfg.GenMappingFileOnly {
return nil
Expand Down

0 comments on commit d756eb1

Please sign in to comment.