Bug 1992474 - `oc registry login` help doc is not updated to use podman default auth
Summary: `oc registry login` help doc is not updated to use podman default auth
Keywords:
Status: CLOSED DUPLICATE of bug 1982498
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: Premerge
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-11 07:46 UTC by XiuJuan Wang
Modified: 2021-09-01 11:54 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-16 14:53:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description XiuJuan Wang 2021-08-11 07:46:22 UTC
Description of problem:
Test https://github.com/openshift/oc/pull/893

$oc registry login -h 

You may also pass the --registry flag to login to the integrated registry but with a custom DNS name, or to an external
registry. Note that in absence of --auth-basic=USER:PASSWORD, the authentication token from the connected kubeconfig
file will be recorded as the auth entry in the credentials file (defaults to Docker config.json) for the passed registry
value.
  -a, --registry-config='': The location of the file your credentials will be stored in. Default is Docker config.json

Version-Release number of selected component (if applicable):

Build oc from https://github.com/openshift/oc/pull/893


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:

Should update like this
-a, --registry-config='': Path to your registry credentials (defaults to ${XDG_RUNTIME_DIR}/containers/auth.json, ${XDG_CONFIG_HOME}/containers/auth.json, ~/.docker/config.json)

Additional info:

Comment 1 Filip Krepinsky 2021-08-11 18:11:52 UTC
This does not have the same impact as using the additional registries as in (https://bugzilla.redhat.com/show_bug.cgi?id=1992468 and https://bugzilla.redhat.com/show_bug.cgi?id=1982498).

This is writing an auth config to just one location. By changing this location we would break backwards compatibility. For example scripts that login with oc registry and run docker on that new registry.

We could implement this by copying the same logic podman uses - ie  picking the most appropriate location. Not always ~/.docker/config.json like we do now even when that location doesn't exist. 
This would work for most of the cases, but would break the backwards compatibility.

@maszulik what are you thoughts on this?

Comment 3 Maciej Szulik 2021-08-16 14:53:13 UTC

*** This bug has been marked as a duplicate of bug 1982498 ***


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