config/credentials: don't run 'pass' to detect it
'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>
This commit is contained in:
@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user