Description of problem:
$ oc config use-context bugzilla-operator/api-cr-j7t7-p1-openshiftapps-com:6443/sttts--GitHub--730123
$ oc get clusteroperators
error: You must be logged in to the server (Unauthorized)
$ oc login
Authentication required for https://api.cr.j7t7.p1.openshiftapps.com:6443 (openshift)
Clicking on the link gives me:
"message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
This is not helpful. I am confused and unhappy as a user. How should I know the URL to the console?
Either redirect directly to the console on platforms that support this (Mac does via `open` command), or at lesat show me a link to the console I can click on.
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.
still unsure of a correct way of fixing this, might not make it to 4.9: https://github.com/openshift/oc/pull/883#discussion_r671472821
not so simple to fix - still pending
added a PR to api-server that adds a support for automatic detection of console URL and redirecting
not managed to push it in 4.10 - moving to 4.11
changes in the api server have been merged, and the oc PR has been updated and is currently under review
can't reproduce the issue now :
oc version --client
Client Version: 4.11.0-0.nightly-2022-06-11-120123
Kustomize Version: v4.5.4
[root@localhost ocmirrortest]# oc config use-context /api-yinzhoudowns-qe-devcluster-openshift-com:6443/testuser-0
Switched to context "/api-yinzhoudowns-qe-devcluster-openshift-com:6443/testuser-0".
[root@localhost ocmirrortest]# oc login
You must obtain an API token by visiting https://oauth-openshift.apps.yinzhoudowns.qe.devcluster.openshift.com/oauth/token/request
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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.