Skip to content

Commit

Permalink
Merge pull request #16868 from juanvallejo/jvallejo/update-dockercfg-…
Browse files Browse the repository at this point in the history
…data-to-dockerconfig-fmt

Automatic merge from submit-queue.

UPSTREAM: 53916: update .dockercfg content to config.json

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1476330

update the data format of .dockercfg to match the new docker config.json
format, which encapsulates all registry auth objects in an overall
"auths" object when an option `--config-format` is specified with the value
`--config-format=config.json`:

```json
{
    "auths": {
        "reg.url": {
            "auth": "...=="
        }
    }
}
```

cc @openshift/cli-review @bparees @mfojtik
  • Loading branch information
openshift-merge-robot authored Oct 26, 2017
2 parents 400b303 + 5304de7 commit 8f5b7ae
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/oc/cli/secrets/dockercfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ func (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error) {
Email: o.EmailAddress,
}

dockerCfg := map[string]credentialprovider.DockerConfigEntry{o.RegistryLocation: dockercfgAuth}
dockerCfg := credentialprovider.DockerConfigJson{
Auths: map[string]credentialprovider.DockerConfigEntry{o.RegistryLocation: dockercfgAuth},
}

dockercfgContent, err := json.Marshal(dockerCfg)
if err != nil {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8f5b7ae

Please sign in to comment.