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)