Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1992474

Summary: `oc registry login` help doc is not updated to use podman default auth
Product: OpenShift Container Platform Reporter: XiuJuan Wang <xiuwang>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED DUPLICATE QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9CC: aos-bugs, danili, fkrepins, jokerman, maszulik, mfojtik
Target Milestone: ---   
Target Release: Premerge   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-16 14:53:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 ***