updating tests, passing down credentials
parent
960118c5cc
commit
a230c1fdd6
|
@ -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"
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue