mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #34537 from AdoHe/get_info
Automatic merge from submit-queue kubectl get print filter info use verbose add a quick fix #34469
This commit is contained in:
commit
20841a5b0e
@ -249,7 +249,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
return fmt.Errorf("unable to output the provided object: %v", err)
|
return fmt.Errorf("unable to output the provided object: %v", err)
|
||||||
}
|
}
|
||||||
filteredResourceCount++
|
filteredResourceCount++
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// print watched changes
|
// print watched changes
|
||||||
@ -273,7 +273,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
filteredResourceCount++
|
filteredResourceCount++
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
@ -351,7 +351,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
errs = append(errs, err)
|
errs = append(errs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||||
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +366,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
filteredResourceCount++
|
filteredResourceCount++
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||||
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
if printer == nil || lastMapping == nil || mapping == nil || mapping.Resource != lastMapping.Resource {
|
if printer == nil || lastMapping == nil || mapping == nil || mapping.Resource != lastMapping.Resource {
|
||||||
if printer != nil {
|
if printer != nil {
|
||||||
w.Flush()
|
w.Flush()
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, filterOpts)
|
||||||
}
|
}
|
||||||
printer, err = f.PrinterForMapping(cmd, mapping, allNamespaces)
|
printer, err = f.PrinterForMapping(cmd, mapping, allNamespaces)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -495,7 +495,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||||||
}
|
}
|
||||||
w.Flush()
|
w.Flush()
|
||||||
if printer != nil && lastMapping != nil {
|
if printer != nil && lastMapping != nil {
|
||||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, errOut, filterOpts)
|
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, filterOpts)
|
||||||
}
|
}
|
||||||
return utilerrors.NewAggregate(allErrs)
|
return utilerrors.NewAggregate(allErrs)
|
||||||
}
|
}
|
||||||
|
@ -704,12 +704,10 @@ func FilterResourceList(obj runtime.Object, filterFuncs kubectl.Filters, filterO
|
|||||||
return filterCount, list, nil
|
return filterCount, list, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrintFilterCount(hiddenObjNum int, resource string, out io.Writer, options *kubectl.PrintOptions) error {
|
func PrintFilterCount(hiddenObjNum int, resource string, options *kubectl.PrintOptions) {
|
||||||
if !options.NoHeaders && !options.ShowAll && hiddenObjNum > 0 {
|
if !options.NoHeaders && !options.ShowAll && hiddenObjNum > 0 {
|
||||||
_, err := fmt.Fprintf(out, " info: %d completed object(s) was(were) not shown in %s list. Pass --show-all to see all objects.\n\n", hiddenObjNum, resource)
|
glog.V(2).Infof(" info: %d completed object(s) was(were) not shown in %s list. Pass --show-all to see all objects.\n\n", hiddenObjNum, resource)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ObjectListToVersionedObject receives a list of api objects and a group version
|
// ObjectListToVersionedObject receives a list of api objects and a group version
|
||||||
|
Loading…
Reference in New Issue
Block a user