mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
create canary apisix object only with the related http route
Signed-off-by: Gallardot <tttick@163.com>
This commit is contained in:
@@ -60,7 +60,7 @@ func (ar *ApisixRouter) Reconcile(canary *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
apexName, primaryName, canaryName := canary.GetServiceNames()
|
||||
targetHttpRoute, targetIndex, err := ar.getTargetHttpRoute(canary, apisixRouteClone, apexName)
|
||||
targetHttpRoute, _, err := ar.getTargetHttpRoute(canary, apisixRouteClone, apexName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (ar *ApisixRouter) Reconcile(canary *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
targetHttpRoute.Backends = append(targetHttpRoute.Backends, canaryBackend)
|
||||
apisixRouteClone.Spec.HTTP[targetIndex] = *targetHttpRoute
|
||||
apisixRouteClone.Spec.HTTP = []a6v2.ApisixRouteHTTP{*targetHttpRoute}
|
||||
|
||||
canaryApisixRouteName := fmt.Sprintf("%s-%s-canary", canary.Spec.RouteRef.Name, apexName)
|
||||
canaryApisixRoute, err := ar.apisixClient.ApisixV2().ApisixRoutes(canary.Namespace).Get(context.TODO(), canaryApisixRouteName, metav1.GetOptions{})
|
||||
|
||||
Reference in New Issue
Block a user