Bug 1861958 - [DOC] recommended mirror 'oc registry login' invocation requires a kubeconfig
Summary: [DOC] recommended mirror 'oc registry login' invocation requires a kubeconfig
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 4.3.z
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.3.z
Assignee: Kathryn Alexander
QA Contact: Johnny Liu
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-30 02:32 UTC by checheng
Modified: 2023-10-06 21:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-04 00:57:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description checheng 2020-07-30 02:32:13 UTC
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:

Comment 1 Johnny Liu 2020-07-30 07:20:24 UTC
[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

Comment 2 Kathryn Alexander 2020-07-31 13:12:02 UTC
PR's here: https://github.com/openshift/openshift-docs/pull/24358

Jianlin, will you PTAL?

Comment 3 Johnny Liu 2020-07-31 14:17:16 UTC
LGTM.

Comment 4 Kathryn Alexander 2020-07-31 17:42:35 UTC
Thank you! I've merged the change and am waiting for it to go live.

Comment 5 checheng 2020-08-03 00:47:13 UTC
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.

Comment 6 Kathryn Alexander 2020-08-03 15:09:43 UTC
Trevor, what do you think about #c5?

Comment 7 W. Trevor King 2020-08-03 18:13:15 UTC
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.

Comment 8 Kathryn Alexander 2020-08-03 18:25:51 UTC
Thank you, Trevor! Chen Cheng, will you please file a separate bug about validating the credentials?

Comment 9 checheng 2020-08-04 00:56:25 UTC
Kathryn Alexander 

Hi 
Thank you for replying and helping.

The doc problem have solved. I will close this ticket.

Best regards.


Note You need to log in before you can comment on or make changes to this bug.