Bug 1874290 - oc registry commands require kubeconfig
Summary: oc registry commands require kubeconfig
Keywords:
Status: CLOSED DUPLICATE of bug 1866588
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-31 22:43 UTC by Robert Bost
Modified: 2024-03-25 16:24 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

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


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