Commit 68e68052 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #35115 from k82cn/k8s_35092

Automatic merge from submit-queue Did not print 'No resources found.' if error. fixes #35092 .
parents 47743a5c 930cd155
...@@ -323,7 +323,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [ ...@@ -323,7 +323,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
} }
errs = append(errs, err) errs = append(errs, err)
} }
if len(infos) == 0 { if len(infos) == 0 && len(errs) == 0 {
outputEmptyListWarning(errOut) outputEmptyListWarning(errOut)
} }
...@@ -375,7 +375,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [ ...@@ -375,7 +375,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
if err != nil { if err != nil {
allErrs = append(allErrs, err) allErrs = append(allErrs, err)
} }
if len(infos) == 0 { if len(infos) == 0 && len(allErrs) == 0 {
outputEmptyListWarning(errOut) outputEmptyListWarning(errOut)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment