Skip to content

Commit

Permalink
only going to lookup secrets if not found in the tracked image
Browse files Browse the repository at this point in the history
  • Loading branch information
rusenask committed Apr 23, 2019
1 parent 6ffad7c commit cc54e08
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/keel-hq/keel/provider/kubernetes"
"github.com/keel-hq/keel/types"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"

log "github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -67,14 +67,16 @@ func (g *DefaultGetter) Get(image *types.TrackedImage) (*types.Credentials, erro

switch image.Provider {
case helm.ProviderName:
// looking up secrets based on selector
secrets, err := g.lookupSecrets(image)
if err != nil {
return nil, err
}
if len(image.Secrets) == 0 {
// looking up secrets based on selector
secrets, err := g.lookupSecrets(image)
if err != nil {
return nil, err
}

// populating secrets
image.Secrets = secrets
// populating secrets
image.Secrets = secrets
}
}
if len(image.Secrets) == 0 {
return nil, ErrSecretsNotSpecified
Expand Down

0 comments on commit cc54e08

Please sign in to comment.