mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
fix: remove linting issues
This commit is contained in:
parent
6c507433e8
commit
e4e1127f8e
7 changed files with 24 additions and 19 deletions
|
@ -48,6 +48,10 @@ func EncodedEnvAuth(ref string) (string, error) {
|
|||
// The docker config must be mounted on the container
|
||||
func EncodedConfigAuth(ref string) (string, error) {
|
||||
server, err := ParseServerAddress(ref)
|
||||
if err != nil {
|
||||
log.Errorf("Unable to parse the image ref %s", err)
|
||||
return "", err
|
||||
}
|
||||
configDir := os.Getenv("DOCKER_CONFIG")
|
||||
if configDir == "" {
|
||||
configDir = "/"
|
||||
|
@ -58,7 +62,8 @@ func EncodedConfigAuth(ref string) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
credStore := CredentialsStore(*configFile)
|
||||
auth, err := credStore.Get(server) // returns (types.AuthConfig{}) if server not in credStore
|
||||
auth, _ := credStore.Get(server) // returns (types.AuthConfig{}) if server not in credStore
|
||||
|
||||
if auth == (types.AuthConfig{}) {
|
||||
log.Debugf("No credentials for %s in %s", server, configFile.Filename)
|
||||
return "", nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue