'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>
(cherry picked from commit 056015c3d8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
14 lines
180 B
Go
14 lines
180 B
Go
package credentials
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
func defaultCredentialsStore() string {
|
|
if _, err := exec.LookPath("pass"); err == nil {
|
|
return "pass"
|
|
}
|
|
|
|
return "secretservice"
|
|
}
|