Change:
What happened: When running and no resource is found, kubectl returns , which is confusing, since we're trying to list instances of a cluster-scoped resource. What you expected to happen: When listing cluster-scoped resources, the message should either be or How to reproduce it (as minimally and precisely as possible): (assuming there are no ; can also try or similar) Environment: Kubernetes version (use ):
/sig cli
/reopen Reopening, because did not fix this issue. It only fixed , which also produced a misleading message, but that's not what this issue is about. This issue is about cluster-scoped resources, not about listing namespaced resources in all namespaces. Output of kubectl get with the changes from included:
Reopened this issue. <detailsIn response to : /reopen </details
/assign
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten
Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . Send feedback to sig-testing, kubernetes/test-infra and/or . /close
Closing this issue. <detailsIn response to : Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . /close Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/reopen This seems to be an error in the get code for kubectl, it looks like it tries to figure out if all the requested resources are namespaced and only then return specify the namespace in the output. This seems to be happening when we have only cluster-wide resources.
You can't reopen an issue/PR unless you authored it or you are a collaborator. <detailsIn response to : /reopen Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/reopen
Reopened this issue. <detailsIn response to : /reopen Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . Send feedback to sig-testing, kubernetes/test-infra and/or . /close
Closing this issue. <detailsIn response to : Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . /close Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details

Discussion:
w.Flush() if trackingWriter.Written == 0 && !o.IgnoreNotFound && len(allErrs) == 0 { // if we wrote no output, and had no errors, and are not ignoring NotFound, be sure we output something <del> noResourcesFoundFormat := fmt.Sprintf("No resources found in %s namespace.", o.Namespace) fmt.Fprintln(o.ErrOut, noResourcesFoundFormat) </del> <ins> if !o.AllNamespaces { fmt.Fprintln(o.ErrOut, fmt.Sprintf("No resources found in %s namespace.", o.Namespace)) } else { fmt.Fprintln(o.ErrOut, fmt.Sprintf("No resources found")) } </ins> } return utilerrors.NewAggregate(allErrs) }