@@ -12,7 +12,7 @@ import (
1212 gatewayApiClientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
1313)
1414
15- func HandleExperiment (ctx context.Context , clientset * kubernetes.Clientset , gatewayClient * gatewayApiClientset.Clientset , logger * logrus.Entry , rollout * v1alpha1.Rollout , httpRoute * gatewayv1.HTTPRoute ) error {
15+ func HandleExperiment (ctx context.Context , clientset * kubernetes.Clientset , gatewayClient * gatewayApiClientset.Clientset , logger * logrus.Entry , rollout * v1alpha1.Rollout , httpRoute * gatewayv1.HTTPRoute , additionalDestinations []v1alpha1. WeightDestination ) error {
1616 ruleIdx := - 1
1717 stableService := rollout .Spec .Strategy .Canary .StableService
1818 canaryService := rollout .Spec .Strategy .Canary .CanaryService
@@ -47,8 +47,8 @@ func HandleExperiment(ctx context.Context, clientset *kubernetes.Clientset, gate
4747 if isExperimentActive {
4848 logger .Info (fmt .Sprintf ("Found active experiment %s" , rollout .Status .Canary .CurrentExperiment ))
4949
50- if len (rollout . Status . Canary . Weights . Additional ) == 0 {
51- logger .Info ("No experiment services found in rollout status , skipping experiment service addition" )
50+ if len (additionalDestinations ) == 0 {
51+ logger .Info ("No experiment services found in additionalDestinations , skipping experiment service addition" )
5252 return nil
5353 }
5454
@@ -60,9 +60,9 @@ func HandleExperiment(ctx context.Context, clientset *kubernetes.Clientset, gate
6060 }
6161 }
6262
63- for _ , additionalDestination := range rollout . Status . Canary . Weights . Additional {
64- serviceName := additionalDestination .ServiceName
65- weight := additionalDestination .Weight
63+ for _ , additionalDest := range additionalDestinations {
64+ serviceName := additionalDest .ServiceName
65+ weight := additionalDest .Weight
6666
6767 exists := false
6868 for _ , backendRef := range httpRoute .Spec .Rules [ruleIdx ].BackendRefs {
0 commit comments