Skip to content

Commit

Permalink
config/credentials: don't run 'pass' to detect it
Browse files Browse the repository at this point in the history
'CheckInitialized' in the credential-helper library actually invokes
`pass`, which isn't desirable (see #699).

This moves the check to be simpler, and then pass will only be invoked
when it's needed (such as for `docker login` or when pulling from a
private registry).

This logic could also reasonably live in the credential-helper library,
but it's simple enough it seems fine in either location.

Signed-off-by: Euan Kemp <euank@euank.com>
  • Loading branch information
euank committed Jun 29, 2018
1 parent ea65e90 commit 056015c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 210 deletions.
5 changes: 2 additions & 3 deletions cli/config/credentials/default_store_linux.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package credentials

import (
"github.com/docker/docker-credential-helpers/pass"
"os/exec"
)

func defaultCredentialsStore() string {
passStore := pass.Pass{}
if passStore.CheckInitialized() {
if _, err := exec.LookPath("pass"); err == nil {
return "pass"
}

Expand Down
207 changes: 0 additions & 207 deletions vendor/github.com/docker/docker-credential-helpers/pass/pass_linux.go

This file was deleted.

0 comments on commit 056015c

Please sign in to comment.