Bug 1282426
| Summary: | The secret cannot be recognized which was added via .docker/config.json | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Meng Bo <bmeng> |
| Component: | oc | Assignee: | Fabiano Franz <ffranz> |
| Status: | CLOSED ERRATA | QA Contact: | Wei Sun <wsun> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.1.0 | CC: | aos-bugs, bleanhar, deads, ffranz, haowang, jialiu, jokerman, mmccomas, xiuwang |
| Target Milestone: | --- | Keywords: | UpcomingRelease |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-01-26 19:19:02 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
Meng Bo
2015-11-16 11:27:40 UTC
# oc logs ruby-sample-build-1-build I1116 05:42:58.879831 1 source.go:145] Cloning source from git://github.com/openshift/ruby-hello-world.git F1116 05:43:00.015844 1 builder.go:59] Build error: '/var/run/secrets/openshift.io/pull/.dockercfg': open /var/run/secrets/openshift.io/pull/.dockercfg: no such file or directory Error like above appears when using the secret which was generated by .docker/config.json Checked with oc version v1.1-148-g16931c3, the issue still can be reproduced. Seems the type defined in kubernetes is incorrect. (but I am not pretty sure) https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L1992 $ oc secrets new test1 .docker/config.json secret/test1 $ oc secrets new test2 .dockerconfigjson secret/test2 $ oc get secret NAME TYPE DATA AGE .... .... test1 Opaque 1 1m test2 kubernetes.io/dockerconfigjson 1 1m @David Can you figure out what are changed? I still get the same result as Comment#3. $ oc secrets new test-1 .docker/config.json secret/test-1 $ oc secrets new test-2 .dockerconfigjson secret/test-2 $ oc get secret NAME TYPE DATA AGE ... test-1 Opaque 1 18s test-2 kubernetes.io/dockerconfigjson 1 3s Since the key name is not a direct filename match, you have to specify the key like this: oc secrets new -o yaml my-secret .dockerconfigjson=.docker/config.json @fabiano Do you think we should add the usage in commnet#5 to the help page? Or else user won't know how to use the .docker/config.json correctly. @meng sure, example added in https://github.com/openshift/origin/pull/6086 Bug has been fixed. The usage print on the help page, and the secret with new docker config format can be identified. $ oc secrets new --help Create a new secret based on a file or directory Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will create a secret using with all valid keys in that directory. Usage: oc secrets new NAME [KEY=]SOURCE ... [options] Examples: ... ... # Create a new .docker/config.json secret named my-secret $ oc secrets new my-secret .dockerconfigjson=path/to/.docker/config.json ... ... [user1@master ~]$ oc secrets new test5 .dockerconfigjson=.docker/config.json secret/test5 [user1@master ~]$ oc get secrets NAME TYPE DATA AGE builder-dockercfg-41nn9 kubernetes.io/dockercfg 1 9s builder-token-aev5c kubernetes.io/service-account-token 2 9s builder-token-n92am kubernetes.io/service-account-token 2 9s default-dockercfg-e4q21 kubernetes.io/dockercfg 1 9s default-token-u7uzm kubernetes.io/service-account-token 2 10s default-token-zi564 kubernetes.io/service-account-token 2 10s deployer-dockercfg-02xeo kubernetes.io/dockercfg 1 8s deployer-token-cdhk9 kubernetes.io/service-account-token 2 8s deployer-token-qvoa8 kubernetes.io/service-account-token 2 9s deployer-token-ubnra kubernetes.io/service-account-token 2 9s test5 kubernetes.io/dockerconfigjson 1 3s 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. https://access.redhat.com/errata/RHSA-2016:0070 |