From 7632003e7af7ac6cd4b202d34094f88ea6671a56 Mon Sep 17 00:00:00 2001 From: Sylvia Lei Date: Wed, 19 Apr 2023 19:27:09 +0800 Subject: [PATCH] add reference Signed-off-by: Sylvia Lei --- default_native_helper_darwin.go | 1 + default_native_helper_linux.go | 1 + default_native_helper_unsupported.go | 1 + default_native_helper_windows.go | 1 + dynamic_store.go | 1 + 5 files changed, 5 insertions(+) diff --git a/default_native_helper_darwin.go b/default_native_helper_darwin.go index abb158d..1a9aca6 100644 --- a/default_native_helper_darwin.go +++ b/default_native_helper_darwin.go @@ -17,6 +17,7 @@ package credentials // getPlatformDefaultHelperSuffix returns the platform default credential // helper suffix. +// Reference: https://docs.docker.com/engine/reference/commandline/login/#default-behavior func getPlatformDefaultHelperSuffix() string { return "osxkeychain" } diff --git a/default_native_helper_linux.go b/default_native_helper_linux.go index cd5de94..f182923 100644 --- a/default_native_helper_linux.go +++ b/default_native_helper_linux.go @@ -19,6 +19,7 @@ import "os/exec" // getPlatformDefaultHelperSuffix returns the platform default credential // helper suffix. +// Reference: https://docs.docker.com/engine/reference/commandline/login/#default-behavior func getPlatformDefaultHelperSuffix() string { if _, err := exec.LookPath("pass"); err == nil { return "pass" diff --git a/default_native_helper_unsupported.go b/default_native_helper_unsupported.go index 7403d87..c506b84 100644 --- a/default_native_helper_unsupported.go +++ b/default_native_helper_unsupported.go @@ -20,6 +20,7 @@ package credentials // getPlatformDefaultHelperSuffix returns the platform default credential // helper suffix. +// Reference: https://docs.docker.com/engine/reference/commandline/login/#default-behavior func getPlatformDefaultHelperSuffix() string { return "" } diff --git a/default_native_helper_windows.go b/default_native_helper_windows.go index b97135f..e334cc7 100644 --- a/default_native_helper_windows.go +++ b/default_native_helper_windows.go @@ -17,6 +17,7 @@ package credentials // getPlatformDefaultHelperSuffix returns the platform default credential // helper suffix. +// Reference: https://docs.docker.com/engine/reference/commandline/login/#default-behavior func getPlatformDefaultHelperSuffix() string { return "wincred" } diff --git a/dynamic_store.go b/dynamic_store.go index d32616b..aa88462 100644 --- a/dynamic_store.go +++ b/dynamic_store.go @@ -117,6 +117,7 @@ func (ds *DynamicStore) getStore(serverAddress string) (Store, error) { } // getDefaultHelperSuffix returns the default credential helper suffix. +// Reference: https://docs.docker.com/engine/reference/commandline/login/#default-behavior func getDefaultHelperSuffix() string { platformDefault := getPlatformDefaultHelperSuffix() if _, err := exec.LookPath(remoteCredentialsPrefix + platformDefault); err == nil {