mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +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).
|
||||
FilenameParam(o.EnforceNamespace, o.FilenameOptions).
|
||||
ResourceTypeOrNameArgs(true, o.BuilderArgs...).
|
||||
SingleResourceType().
|
||||
ContinueOnError().
|
||||
Latest().
|
||||
Do()
|
||||
|
||||
err := r.Err()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
infos, err := r.Infos()
|
||||
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]
|
||||
return r.Visit(func(info *resource.Info, err error) error {
|
||||
mapping := info.ResourceMapping()
|
||||
|
||||
statusViewer, err := o.StatusViewerFn(mapping)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -237,4 +230,5 @@ func (o *RolloutStatusOptions) Run() error {
|
||||
})
|
||||
return err
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user