Skip to content

Commit

Permalink
fix: High reconciliation activity and CPU load for invalid rollout
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Perenesenko <[email protected]>
  • Loading branch information
perenesenko committed Jun 10, 2022
1 parent 3f5960e commit e0eba31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/rollouts/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ func ValidateRolloutStrategyCanary(rollout *v1alpha1.Rollout, fldPath *field.Pat
if step.Pause != nil && step.Pause.DurationSeconds() < 0 {
allErrs = append(allErrs, field.Invalid(stepFldPath.Child("pause").Child("duration"), step.Pause.DurationSeconds(), InvalidDurationMessage))
}
if rollout.Spec.Strategy.Canary != nil && rollout.Spec.Strategy.Canary.TrafficRouting == nil && step.SetCanaryScale != nil {
allErrs = append(allErrs, field.Invalid(stepFldPath.Child("setCanaryScale"), step.SetCanaryScale, InvalidSetCanaryScaleTrafficPolicy))
if step.SetCanaryScale != nil && canary.TrafficRouting == nil {
allErrs = append(allErrs, field.Required(fldPath.Child("trafficRouting"), InvalidSetCanaryScaleTrafficPolicy))
}
if step.SetHeaderRouting != nil {
trafficRouting := rollout.Spec.Strategy.Canary.TrafficRouting
Expand Down

0 comments on commit e0eba31

Please sign in to comment.