mirror of https://github.com/k3s-io/k3s
Merge pull request #34537 from AdoHe/get_info
Automatic merge from submit-queue kubectl get print filter info use verbose add a quick fix #34469pull/6/head
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)
|
||||
}
|
||||
filteredResourceCount++
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||
}
|
||||
|
||||
// print watched changes
|
||||
|
@ -273,7 +273,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||
return false, err
|
||||
}
|
||||
filteredResourceCount++
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, mapping.Resource, filterOpts)
|
||||
return false, nil
|
||||
})
|
||||
return err
|
||||
|
@ -351,7 +351,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||
errs = append(errs, err)
|
||||
}
|
||||
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||
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++
|
||||
}
|
||||
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, res, filterOpts)
|
||||
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 {
|
||||
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 {
|
||||
|
@ -495,7 +495,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
|||
}
|
||||
w.Flush()
|
||||
if printer != nil && lastMapping != nil {
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, errOut, filterOpts)
|
||||
cmdutil.PrintFilterCount(filteredResourceCount, lastMapping.Resource, filterOpts)
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
|
|
@ -704,12 +704,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