mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Extend test SetupMocks() to take arbitrary Canary resources
SetupMocks() currently takes a bool switch that tells it to configure against either a shifting canary or an A-B canary. I'll need a third canary that has mirroring turned on so I changed this to an interface that just takes the canary to configure (and configs the default shifting canary if you pass nil).
This commit is contained in:
@@ -42,11 +42,9 @@ type Mocks struct {
|
||||
router router.Interface
|
||||
}
|
||||
|
||||
func SetupMocks(abtest bool) Mocks {
|
||||
// init canary
|
||||
c := newTestCanary()
|
||||
if abtest {
|
||||
c = newTestCanaryAB()
|
||||
func SetupMocks(c *v1alpha3.Canary) Mocks {
|
||||
if c == nil {
|
||||
c = newTestCanary()
|
||||
}
|
||||
flaggerClient := fakeFlagger.NewSimpleClientset(c)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user