Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix repo name passed to docker credential helpers #3165

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ BUG FIXES:
* driver/docker: Fix issue in which mounts could parse incorrectly [GH-3163]
* driver/docker: Fix issue where potentially incorrect syslog server address is
used [GH-3135]
* driver/docker: Fix server url passed to credential helpers and properly
capture error output [GH-3165]
* jobspec: Allow distinct_host constraint to have L/RTarget set [GH-3136]

## 0.6.2 (August 28, 2017)
Expand Down
10 changes: 8 additions & 2 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1795,15 +1795,21 @@ 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)
}

cmd.Stdin = strings.NewReader(repo)

output, err := cmd.Output()
if err != nil {
switch e := err.(type) {
switch err.(type) {
default:
return nil, err
case *exec.ExitError:
return nil, fmt.Errorf("%s failed with stderr: %s", helper, string(e.Stderr))
return nil, fmt.Errorf("%s with input %q failed with stderr: %s", helper, repo, output)
}
}

Expand Down