From b31015b59157a780851d46e64998c4abbefd419c Mon Sep 17 00:00:00 2001 From: Andrii Perenesenko Date: Tue, 31 May 2022 11:19:11 -0700 Subject: [PATCH] feat: Allow Traffic shaping through header based routing ALB fix tests Signed-off-by: Andrii Perenesenko --- pkg/apis/rollouts/validation/validation.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/apis/rollouts/validation/validation.go b/pkg/apis/rollouts/validation/validation.go index 836c9befad..60d8e79fb3 100644 --- a/pkg/apis/rollouts/validation/validation.go +++ b/pkg/apis/rollouts/validation/validation.go @@ -302,8 +302,7 @@ func ValidateRolloutStrategyCanary(rollout *v1alpha1.Rollout, fldPath *field.Pat trafficRouting := rollout.Spec.Strategy.Canary.TrafficRouting if trafficRouting == nil || (trafficRouting.Istio == nil && trafficRouting.ALB == nil) { allErrs = append(allErrs, field.Invalid(stepFldPath.Child("setHeaderRouting"), step.SetHeaderRouting, InvalidSetHeaderRoutingTrafficPolicy)) - } - if step.SetHeaderRouting.Match != nil && len(step.SetHeaderRouting.Match) > 0 { + } else if step.SetHeaderRouting.Match != nil && len(step.SetHeaderRouting.Match) > 0 { for j, match := range step.SetHeaderRouting.Match { if trafficRouting.ALB != nil { matchFld := stepFldPath.Child("setHeaderRouting").Child("match").Index(j)