Document URL: https://access.redhat.com/documentation/en-us/openshift_container_platform/4.5/html/installing/installation-configuration#installing-restricted-networks-preparations Section Number and Name: 3.3.3. Configuring credentials that allow images to be mirrored Describe the issue: The command below doesn't work when kubeconfig not exist. oc registry login --to ./pull-secret.json --registry "<registry_host_and_port>" Suggestions for improvement: The podman command is better when user want to set the auth info to local file. podman login -u <username> -p <password> --authfile ./pull-secret.json example.registry.local:5000 Additional information:
[root@preserve-jialiu-ansible ~]# oc registry login --to ./pull-secret.json --registry hehe.mirror-registry.qe.devcluster.openshift.com:5000 error: no token is currently in use for this session Maybe we can add --auth-basic to be more specific: [root@preserve-jialiu-ansible ~]# oc registry login --to ./pull-secret.json --registry hehe.mirror-registry.qe.devcluster.openshift.com:5000 --auth-basic=xxx:yyy Saved credentials for upshift.mirror-registry.qe.devcluster.openshift.com:5000
PR's here: https://github.com/openshift/openshift-docs/pull/24358 Jianlin, will you PTAL?
LGTM.
Thank you! I've merged the change and am waiting for it to go live.
Thank you for replying so quickly. I found one point that `oc registry login` will not check the username and password, even user input wrong username or password. The info will store in secret json file. Do you think this info should include in the document? Or this is a problem should be solved. The podman command is confirm the auth info first, if response is OK then save the username and password into the pull secret file.
Trevor, what do you think about #c5?
Makes sense to me to have 'oc' attempt to verify the credentials, although I'm not clear on how that gets implemented generically (if Podman does it, seems like it should be possible ;). Probably a separate bug, in any case.
Thank you, Trevor! Chen Cheng, will you please file a separate bug about validating the credentials?
Kathryn Alexander Hi Thank you for replying and helping. The doc problem have solved. I will close this ticket. Best regards.
Here's the link to the change on docs.openshift.com: https://docs.openshift.com/container-platform/4.5/installing/install_config/installing-restricted-networks-preparations.html#installation-adding-registry-pull-secret_installing-restricted-networks-preparations and on the portal: https://access.redhat.com/documentation/en-us/openshift_container_platform/4.5/html/installing/installation-configuration#installation-adding-registry-pull-secret_installing-restricted-networks-preparations