Skip to content

Commit

Permalink
more errors when secrets not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rusenask committed Apr 24, 2019
1 parent d6ba949 commit 791d1fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (g *DefaultGetter) getCredentialsFromSecret(image *types.TrackedImage) (*ty
continue
}

dockerCfg := make(DockerCfg)
var dockerCfg DockerCfg

switch secret.Type {
case v1.SecretTypeDockercfg:
Expand Down Expand Up @@ -222,6 +222,11 @@ func (g *DefaultGetter) getCredentialsFromSecret(image *types.TrackedImage) (*ty
creds, found := credentialsFromConfig(image, dockerCfg)
if found {
return creds, nil
} else {
log.WithFields(log.Fields{
"secret_ref": secretRef,
"image": image.Image.String(),
}).Warn("secrets.defaultGetter: registry not found among secrets")
}
}

Expand All @@ -240,7 +245,7 @@ func (g *DefaultGetter) getCredentialsFromSecret(image *types.TrackedImage) (*ty
"registry": image.Image.Registry(),
"image": image.Image.Repository(),
"secrets": image.Secrets,
}).Warnf("secrets.defaultGetter.lookupSecrets: docker credentials were not found among secrets, is secret in the namespace '%s'?", image.Namespace)
}).Errorf("secrets.defaultGetter.lookupSecrets: docker credentials were not found among secrets, is secret in the namespace '%s'?", image.Namespace)
}

return credentials, nil
Expand Down

0 comments on commit 791d1fa

Please sign in to comment.