Bug 1874290

Summary: oc registry commands require kubeconfig
Product: OpenShift Container Platform Reporter: Robert Bost <rbost>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED DUPLICATE QA Contact: zhou ying <yinzhou>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: aos-bugs, jokerman, mfojtik
Target Milestone: ---Keywords: Reopened
Target Release: ---   
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: 2020-11-03 09:00:31 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 Robert Bost 2020-08-31 22:43:58 UTC
Description of problem:

oc registry login requires a kubeconfig. Various docs bugs have been filed for this:

bz1857296
bz1861958
bz1866588

It seems that the oc registry login command requires a kubeconfig even if flags are provided that do not use a kubeconfig, specifically the --auth-basic flag. 


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


How reproducible: Always


Steps to Reproduce:

$ oc registry login --to ./nowhere.json --registry nowhere:5000 --auth-basic=nothing:nothing
error: Missing or incomplete configuration info.  Please point to an existing, complete config file:


  1. Via the command-line flag --kubeconfig
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

To view or setup config directly use the 'config' command.

Comment 1 Robert Bost 2020-08-31 22:45:41 UTC
The following lines seem to be the offender:

  release-4.5 branch
  https://github.com/openshift/oc/blob/5e7af8cc3c5694f7cc22ae3f2f1e54cccc485afe/pkg/cli/registry/login/login.go#L151-L154

Comment 2 Robert Bost 2020-08-31 23:11:48 UTC
I've submitted https://github.com/openshift/oc/pull/542 for review

Comment 3 Maciej Szulik 2020-09-01 13:45:10 UTC
Since oc registry login is targeted at users of the internal registry, which in majority cases means re-using cluster credentials
we're not envisioning changing oc registry login with this ask. It is sufficient to update the documentation accordingly.

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

Comment 4 Maciej Szulik 2020-11-03 09:00:31 UTC

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