From 791d1fa6d3787c580b3731607422095628155b4d Mon Sep 17 00:00:00 2001 From: Karolis Rusenas Date: Wed, 24 Apr 2019 22:59:09 +0100 Subject: [PATCH] more errors when secrets not found --- secrets/secrets.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/secrets/secrets.go b/secrets/secrets.go index 106f3af9..6ea2422b 100644 --- a/secrets/secrets.go +++ b/secrets/secrets.go @@ -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: @@ -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") } } @@ -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