mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
kubectl get print filter info use verbose
This commit is contained in:
parent
8179f4d1a3
commit
219006a277
@ -248,7 +248,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
return fmt.Errorf("unable to output the provided object: %v", err)
|
||||
}
|
||||
filteredResourceCount++
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||
}
|
||||
|
||||
// print watched changes
|
||||
@ -272,7 +272,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
return false, err
|
||||
}
|
||||
filteredResourceCount++
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||
return false, nil
|
||||
})
|
||||
return err
|
||||
@ -347,7 +347,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
errs = append(errs, err)
|
||||
}
|
||||
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
filteredResourceCount++
|
||||
}
|
||||
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||
return utilerrors.Reduce(utilerrors.Flatten(utilerrors.NewAggregate(errs)))
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
if printer == nil || lastMapping == nil || mapping == nil || mapping.Resource != lastMapping.Resource {
|
||||
if printer != nil {
|
||||
w.Flush()
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, filterOpts)
|
||||
}
|
||||
printer, err = f.PrinterForMapping(cmd, mapping, allNamespaces)
|
||||
if err != nil {
|
||||
@ -488,7 +488,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
|
||||
}
|
||||
w.Flush()
|
||||
if printer != nil && lastMapping != nil {
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, filterOpts)
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
@ -698,12 +698,10 @@ func FilterResourceList(obj runtime.Object, filterFuncs kubectl.Filters, filterO
|
||||
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 {
|
||||
_, 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)
|
||||
return err
|
||||
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 nil
|
||||
}
|
||||
|
||||
// ObjectListToVersionedObject receives a list of api objects and a group version
|
||||
|
Loading…
Reference in New Issue
Block a user