mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #26242 from metral/refactor-get
Automatic merge from submit-queue fix recursive get for proper err display - refactor code to use `Infos()` instead - fixes https://github.com/kubernetes/kubernetes/issues/26241
This commit is contained in:
commit
e531a7784e
@ -219,15 +219,8 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
|
||||
return err
|
||||
}
|
||||
|
||||
infos := []*resource.Info{}
|
||||
allErrs := []error{}
|
||||
err = r.Visit(func(info *resource.Info, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
infos = append(infos, info)
|
||||
return nil
|
||||
})
|
||||
infos, err := r.Infos()
|
||||
if err != nil {
|
||||
allErrs = append(allErrs, err)
|
||||
}
|
||||
@ -322,5 +315,5 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
|
||||
continue
|
||||
}
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
return utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user