Skip to content

Commit

Permalink
Improve "flux resume" error message on non-existent object
Browse files Browse the repository at this point in the history
Signed-off-by: Sjors Holtrop <[email protected]>
  • Loading branch information
sjorsholtrop-ritense committed Jan 14, 2025
1 parent 16ae23a commit 8b10a32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/flux/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ func (resume *resumeCommand) getPatchedResumables(ctx context.Context, args []st
}
processed[arg] = struct{}{}

if resume.list.len() == 0 {
logger.Failuref("%s object '%s' not found in %s namespace", resume.kind, arg, resume.namespace)
continue
}

objs, err := resume.patch(ctx, []client.ListOption{
client.InNamespace(resume.namespace),
client.MatchingFields{
Expand All @@ -174,11 +179,6 @@ func (resume resumeCommand) patch(ctx context.Context, listOpts []client.ListOpt
return nil, err
}

if resume.list.len() == 0 {
logger.Failuref("no %s objects found in %s namespace", resume.kind, resume.namespace)
return nil, nil
}

var resumables []resumable

for i := 0; i < resume.list.len(); i++ {
Expand Down

0 comments on commit 8b10a32

Please sign in to comment.