+++ This bug was initially created as a clone of Bug #1826676 +++ When a user runs `oc project` but the kubeconfig current context is a project that has been deleted (only way this will happen is if user has no other projects) the user gets a misleading error. The error message should be improved. How reproducible: Always Steps to Reproduce: 1) Login to an existing cluster $ oc new-project test $ oc delete project test $ oc project user gets misleading error: 'error: you do not have rights to view project "test".' If user has no projects, should instead see 'error: You are not a member of any projects. You can request a project to be created with the 'new-project' command.'
The problem appears when you're using a regular non-system:admin user: oc project error: you do not have rights to view project "tesla" with system:admin the message is ok: oc status error: the project "tesla" specified in your config does not exist
This bug is actively being worked on.
$ ./oc version -o yaml clientVersion: buildDate: "2020-05-26T21:24:07Z" compiler: gc gitCommit: 384535d084fda4ab8b3e37c995bf20ed46dbce51 gitTreeState: dirty gitVersion: 384535d0 goVersion: go1.13.4 major: "" minor: "" platform: windows/amd64 $ ./oc project error: you do not have rights to view project "zhouy" specified in your config or the project doesn't exist
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-2020:2409