Description of problem: When token expired and command uses short name type, it prompts server doesn't have a resource type Version-Release number of selected component (if applicable): v3.9.0-0.24.0 How reproducible: Always Steps to Reproduce: 1. oc logins to server 2. After a day token expired or make token expired by: $ oc config view --minify > mylogin.config $ oc logout Logged "xxia" out on "https://MASTER:8443" $ cp mylogin.config ~/.kube/config Then run: $ oc get po # short name the server doesn't have a resource type "po" $ oc get pod error: You must be logged in to the server (Unauthorized) Actual results: 1. Check ~/.kube/, there is ~/.kube/MASTER_CONTEXT_NAME/v1/serverresources.json which shows: {"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","proxy","update","watch"],"shortNames":["po"],"categories":["all"]} 2. More log info: $ oc get po --loglevel 6 I0125 15:14:04.566929 30695 loader.go:357] Config loaded from file /home/tester/.kube/config I0125 15:14:05.646002 30695 round_trippers.go:436] GET https://MASTER:8443/api 401 Unauthorized in 1078 milliseconds I0125 15:14:05.646832 30695 cached_discovery.go:124] skipped caching discovery info due to Unauthorized I0125 15:14:05.916845 30695 round_trippers.go:436] GET https://MASTER:8443/api 401 Unauthorized in 269 milliseconds I0125 15:14:05.917500 30695 cached_discovery.go:124] skipped caching discovery info due to Unauthorized I0125 15:14:06.828112 30695 round_trippers.go:436] GET https://MASTER:8443/api 401 Unauthorized in 909 milliseconds I0125 15:14:06.829007 30695 cached_discovery.go:124] skipped caching discovery info due to Unauthorized I0125 15:14:06.829271 30695 factory_object_mapping.go:93] Unable to retrieve API resources, falling back to hardcoded types: Unauthorized F0125 15:14:06.830405 30695 helpers.go:119] the server doesn't have a resource type "po" It knows 'unauthorized' but it does not prompt 'unauthorized' without '--loglevel' Expected results: 2. No matter command uses short name or full name, it should prompt 'unauthorized' when user does not specify --loglevel in command Additional info:
This will be addressed by [1]. The error after applying [1] is: ``` $ KUBECONFIG=mylogin.config oc get po error: You must be logged in to the server (the server has asked for the client to provide credentials (get pods)) ``` 1. https://github.com/openshift/origin/pull/18137
The fix landed in 3.10, moving to qa.
Verified in OCP c/s v3.10.118, oc get po(d) both can show error: You must be logged in to the server (Unauthorized)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0620