mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
kubectl rollout: support recursive flag for rollout status
This commit is contained in:
parent
f173d01c01
commit
9d8286c82c
@ -168,24 +168,17 @@ func (o *RolloutStatusOptions) Run() error {
|
|||||||
LabelSelectorParam(o.LabelSelector).
|
LabelSelectorParam(o.LabelSelector).
|
||||||
FilenameParam(o.EnforceNamespace, o.FilenameOptions).
|
FilenameParam(o.EnforceNamespace, o.FilenameOptions).
|
||||||
ResourceTypeOrNameArgs(true, o.BuilderArgs...).
|
ResourceTypeOrNameArgs(true, o.BuilderArgs...).
|
||||||
SingleResourceType().
|
ContinueOnError().
|
||||||
Latest().
|
Latest().
|
||||||
Do()
|
Do()
|
||||||
|
|
||||||
err := r.Err()
|
err := r.Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
infos, err := r.Infos()
|
return r.Visit(func(info *resource.Info, err error) error {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if len(infos) != 1 {
|
|
||||||
return fmt.Errorf("rollout status is only supported on individual resources and resource collections - %d resources were found", len(infos))
|
|
||||||
}
|
|
||||||
info := infos[0]
|
|
||||||
mapping := info.ResourceMapping()
|
mapping := info.ResourceMapping()
|
||||||
|
|
||||||
statusViewer, err := o.StatusViewerFn(mapping)
|
statusViewer, err := o.StatusViewerFn(mapping)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -237,4 +230,5 @@ func (o *RolloutStatusOptions) Run() error {
|
|||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user