Skip to content

Commit

Permalink
client/driver: use correct repo address when using docker-credential …
Browse files Browse the repository at this point in the history
…helper
  • Loading branch information
nickethier committed May 8, 2018
1 parent 517d0ee commit 0ca49c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ IMPROVEMENTS:
jobspec [[GH-4239](https://github.com/hashicorp/nomad/issues/4239)]
* discovery: Support Consul gRPC health checks. [[GH-4251](https://github.com/hashicorp/nomad/issues/4251)]
* driver/docker: Add progress monitoring and inactivity detection to docker
image pulls [[GH-4192](https://github.com/hashicorp/nomad/issues/4192)]
image pulls [[GH-4192](https://github.com/hashicorp/nomad/issues/4192)]

BUG FIXES:
* driver/docker: Fix docker credential helper support [[GH-3818](https://github.com/hashicorp/nomad/issues/3818)] [[GH-4221](https://github.com/hashicorp/nomad/issues/4221)]

## 0.8.3 (April 27, 2018)

Expand Down
10 changes: 6 additions & 4 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2130,13 +2130,15 @@ func authFromHelper(helperName string) authBackend {
helper := dockerAuthHelperPrefix + helperName
cmd := exec.Command(helper, "get")

// Ensure that the HTTPs prefix exists
if !strings.HasPrefix(repo, "https://") {
repo = fmt.Sprintf("https://%s", repo)
repoInfo, err := parseRepositoryInfo(repo)
if err != nil {
return nil, err
}

cmd.Stdin = strings.NewReader(repo)
// Ensure that the HTTPs prefix exists
repoAddr := fmt.Sprintf("https://%s", repoInfo.Hostname())

cmd.Stdin = strings.NewReader(repoAddr)
output, err := cmd.Output()
if err != nil {
switch err.(type) {
Expand Down

0 comments on commit 0ca49c0

Please sign in to comment.