When we try to retrieve any resource for a specific namespace that does not exist, the command executes successfully. However, it should show an error indicating that the namespace does not exist.
For example:
Suppose you execute kubectl get pods -n discuss
, but the namespace discuss does not exist in the cluster. Instead of showing an error message like Namespace 'discuss' does not exist
, the kubectl
command executes successfully and returns the following, similar to a valid namespace with no resources:
No resources found in discuss namespace.
This behavior can cause confusion and might lead to debugging issues.