mirror of
https://github.com/fluxcd/flagger.git
synced 2026-03-03 02:00:18 +00:00
The mirror option will be used to tell routers to configure traffic mirroring. Implement mirror for GetRoutes and SetRoutes for Istio. For other routers, GetRoutes always returns mirror == false, and SetRoutes ignores mirror. After this change there is no behavior change because no code sets mirror true (yet). Enhanced TestIstioRouter_SetRoutes and TestIstioRouter_GetRoutes.
25 lines
574 B
Go
25 lines
574 B
Go
package router
|
|
|
|
import (
|
|
flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1alpha3"
|
|
)
|
|
|
|
// NopRouter no-operation router
|
|
type NopRouter struct {
|
|
}
|
|
|
|
func (*NopRouter) Reconcile(canary *flaggerv1.Canary) error {
|
|
return nil
|
|
}
|
|
|
|
func (*NopRouter) SetRoutes(canary *flaggerv1.Canary, primaryWeight int, canaryWeight int, mirror bool) error {
|
|
return nil
|
|
}
|
|
|
|
func (*NopRouter) GetRoutes(canary *flaggerv1.Canary) (primaryWeight int, canaryWeight int, mirror bool, err error) {
|
|
if canary.Status.Iterations > 0 {
|
|
return 0, 100, false, nil
|
|
}
|
|
return 100, 0, false, nil
|
|
}
|