Bug 1696366 - oc registry tools read $PWD/config.json if existing and assume it's a docker config => auth errors
Summary: oc registry tools read $PWD/config.json if existing and assume it's a docker ...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Maciej Szulik
QA Contact: zhou ying
Depends On:
TreeView+ depends on / blocked
Reported: 2019-04-04 16:02 UTC by Stefan Schimanski
Modified: 2019-06-04 10:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2019-06-04 10:47:03 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:47:11 UTC

Description Stefan Schimanski 2019-04-04 16:02:11 UTC
Description of problem:

A config.json in the current directory is considered as docker config.json with credentials. If it exists ~/.docker/config.json is not read. Command like `oc adm release` fail with auth error to upload images because no auth tokens are loaded.

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

3 year old code in k/k/pkg/credentialprovider/config.go:84 used by oc. So probably it is in old version. Found in current origin master.

How reproducible:

echo '{}' > config.json; oc adm release ... => auth error

Actual results:

auth error when uploading to Docker hub

Expected results:

successful image push.

Additional info:

Comment 1 Maciej Szulik 2019-04-05 20:33:46 UTC
This is not a 4.1 blocker, moving target to 4.2.

Comment 2 Maciej Szulik 2019-04-17 11:13:29 UTC
Fix in https://github.com/openshift/origin/pull/22569

Comment 3 zhou ying 2019-04-22 05:54:00 UTC
Confirmed with latest oc client, the issue can't be reproduced:
[root@dhcp-140-138 ~]# oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0", GitCommit:"74c534b60", GitTreeState:"", BuildDate:"2019-04-21T21:13:18Z", GoVersion:"", Compiler:"", Platform:""}

[root@dhcp-140-138 ~]# echo '{}' > config.json
[root@dhcp-140-138 ~]# ll -t
total 43600
-rw-r--r--. 1 root root        3 Apr 22 13:41 config.json

[root@dhcp-140-138 ~]# more config.json 

[root@dhcp-140-138 ~]# oc adm release info --commits registry.svc.ci.openshift.org/ocp/release:4.1.0-0.nightly-2019-04-22-005054
Name:      4.1.0-0.nightly-2019-04-22-005054
Digest:    sha256:3f3628cd9b694705cb0627ce72e61932df5d9938a291fabba1ed691230f7b548
Created:   2019-04-22T00:54:08Z
OS/Arch:   linux/amd64
Manifests: 273

Pull From: registry.svc.ci.openshift.org/ocp/release@sha256:3f3628cd9b694705cb0627ce72e61932df5d9938a291fabba1ed691230f7b548

Release Metadata:
  Version:  4.1.0-0.nightly-2019-04-22-005054
  Upgrades: <none>

Component Versions:
  Kubernetes 1.13.4

Comment 5 errata-xmlrpc 2019-06-04 10:47:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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