mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-21 23:21:48 +00:00
Improve "flux resume" error message on non-existent object
Signed-off-by: Sjors Holtrop <sjors.holtrop@ritense.com>
This commit is contained in:
parent
16ae23a3a6
commit
8b10a32088
1 changed files with 5 additions and 5 deletions
|
|
@ -151,6 +151,11 @@ func (resume *resumeCommand) getPatchedResumables(ctx context.Context, args []st
|
||||||
}
|
}
|
||||||
processed[arg] = struct{}{}
|
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{
|
objs, err := resume.patch(ctx, []client.ListOption{
|
||||||
client.InNamespace(resume.namespace),
|
client.InNamespace(resume.namespace),
|
||||||
client.MatchingFields{
|
client.MatchingFields{
|
||||||
|
|
@ -174,11 +179,6 @@ func (resume resumeCommand) patch(ctx context.Context, listOpts []client.ListOpt
|
||||||
return nil, err
|
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
|
var resumables []resumable
|
||||||
|
|
||||||
for i := 0; i < resume.list.len(); i++ {
|
for i := 0; i < resume.list.len(); i++ {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue