updating tests, passing down credentials

pull/65/head
Karolis Rusenas 2017-07-28 23:26:25 +01:00
parent 960118c5cc
commit a230c1fdd6
2 changed files with 14 additions and 1 deletions

View File

@ -10,6 +10,13 @@ import (
"testing"
)
type FakeSecretsGetter struct {
}
func (g *FakeSecretsGetter) Get(image *types.TrackedImage) (*types.Credentials, error) {
return &types.Credentials{}, nil
}
func TestCheckDeployment(t *testing.T) {
// fake provider listening for events
imgA, _ := image.Parse("gcr.io/v2-namespace/hello-world:1.1.1")
@ -41,7 +48,7 @@ func TestCheckDeployment(t *testing.T) {
watcher := NewRepositoryWatcher(providers, frc)
pm := NewPollManager(providers, watcher)
pm := NewPollManager(providers, watcher, &FakeSecretsGetter{})
imageA := "gcr.io/v2-namespace/hello-world:1.1.1"
imageB := "gcr.io/v2-namespace/greetings-world:1.1.1"

View File

@ -169,6 +169,8 @@ func (w *RepositoryWatcher) addJob(ref *image.Reference, registryUsername, regis
Registry: reg,
Name: ref.ShortName(),
Tag: ref.Tag(),
Username: registryUsername,
Password: registryPassword,
})
if err != nil {
log.WithFields(log.Fields{
@ -243,6 +245,8 @@ func (j *WatchTagJob) Run() {
Registry: reg,
Name: j.details.imageRef.ShortName(),
Tag: j.details.imageRef.Tag(),
Username: j.details.registryUsername,
Password: j.details.registryPassword,
})
if err != nil {
@ -310,6 +314,8 @@ func (j *WatchRepositoryTagsJob) Run() {
Registry: reg,
Name: j.details.imageRef.ShortName(),
Tag: j.details.latest,
Username: j.details.registryUsername,
Password: j.details.registryPassword,
})
if err != nil {