Description of problem: Meet the info "factory_object_mapping.go ... Unable to get a discovery client to find server resources" when prompting "the server doesn't have a resource type" Version-Release number of selected component (if applicable): oc/OCP v3.9.0-0.9.0 How reproducible: Always Steps to Reproduce: 1. oc login to server oc version oc v3.9.0-0.9.0 kubernetes v1.8.1+0d5291c features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://MASTER:8443 openshift v3.9.0-0.9.0 kubernetes v1.8.1+0d5291c 2. run `oc get svc --user=no-this-user --loglevel=6` Actual results: 2. It outputs: I1228 05:20:03.253275 121061 loader.go:357] Config loaded from file /home/xxia/.kube/config I1228 05:20:03.253487 121061 factory_object_mapping.go:83] Unable to get a discovery client to find server resources, falling back to hardcoded types: auth info "no-this-user" does not exist F1228 05:20:03.253696 121061 helpers.go:119] the server doesn't have a resource type "svc" As comparison, run step 2's command with oc/OCP v3.9.0-0.8.0, it'll give good info, as before. $ oc version oc v3.9.0-0.8.0 kubernetes v1.8.1+0d5291c features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://MASTER:8443 openshift v3.9.0-0.8.0 kubernetes v1.8.1+0d5291c $ oc get svc --user=no-this-user --loglevel=6 I1228 05:20:08.471554 110834 loader.go:357] Config loaded from file /home/xxia/.kube/config F1228 05:20:08.471859 110834 helpers.go:120] error: auth info "no-this-user" does not exist Expected results: 2. Should not prompt the server doesn't have a resource type "svc" Additional info: v3.9.0-0.8.0 doesn't include https://github.com/openshift/origin/pull/17576, while v3.9.0-0.9.0 includes Thus not sure if it is brought by https://trello.com/c/xe4LrWHd/1095-cli-cli-printers-sanitize-printing-options and https://trello.com/c/jkAVhKgQ/1059-cli-cli-printers-move-printer-handler-registration-to-the-factory, and seems it is not same as https://bugzilla.redhat.com/show_bug.cgi?id=1515878
@David, This is happening because resource shortcuts are not being expanded. Doing something like `oc get services --user=no-this-user --loglevel=6` does not return an error about the resource not existing. We seem to have handled a discovery client not existing the same way we do now back in 3.8 [1]. Did the behavior of `legacyscheme.Registry.RESTMapper()` or the resource builder change? 1. https://github.com/openshift/origin/blob/release-3.8/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory_object_mapping.go#L98
The entire mapper/typer flow changed in 1.9. Given that all resources should be discovered, the inability to create a client to look up resources is fatal. I think that https://github.com/kubernetes/kubernetes/pull/58293 makes it so.
https://github.com/kubernetes/kubernetes/pull/58293 was just merged a day ago. Waiting new puddle that will include rebase of it to verify.
Still not merged in v3.9.0-0.22.0. Moving to MODIFIED. What's the rebase PR for rebasing the code downstream so that it can be subscribed and tested when rebase is done?
Hi Juan, the bug fix will lands in 3.10, right [1]? If yes, please change Target Release and then please Samuel drop from above 3.9 advisory. Currently no latest 3.10 env for verification due to installer bugs, which I'll watch. [1] Test with latest 3.9 version 3.9.20 (kubernetes v1.9.1+a0ce1bc657) still reproduces bug.
Samuel, hi, please help drop this bug from above advisory, thanks
Checked in env: oc v3.10.0-0.21.0 kubernetes v1.10.0+b81c8f8 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://$MASTER_HOST:8443 openshift v3.10.0-0.21.0 kubernetes v1.10.0+b81c8f8 v3.10.0-0.21.0 merged the rebase PR https://github.com/openshift/origin/pull/19137 , tut bug is still reproduced. BTW, Samuel, bug is still in advisory, please drop
Still exist in latest 3.10 oc v3.10.118. Fixed in oc v3.11.86: 3.10.118/oc get svc --user=no-this-user error: the server doesn't have a resource type "svc" 3.11.86/oc get svc --user=no-this-user error: auth info "no-this-user" does not exist Since bug is low, IMO target field can be changed.
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:0636