Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andyliuliming committed Dec 13, 2023
1 parent 79c4540 commit 0d4677b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/apis/rollouts/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,17 @@ func TestValidateRolloutStrategyCanary(t *testing.T) {
assert.Equal(t, fmt.Sprintf(InvalidSetWeightMessage, 100), allErrs[0].Detail)
})

t.Run("only nginx/plugins support max weight value", func(t *testing.T) {
anyWeight := int32(1)
invalidRo := ro.DeepCopy()
invalidRo.Spec.Strategy.Canary.TrafficRouting = &v1alpha1.RolloutTrafficRouting{
ALB: &v1alpha1.ALBTrafficRouting{RootService: "root-service"},
MaxTrafficWeight: &anyWeight,
}
allErrs := ValidateRolloutStrategyCanary(invalidRo, field.NewPath(""))
assert.Equal(t, InvalidCanaryMaxWeightOnlySupportInNginxAndPlugins, allErrs[0].Detail)
})

t.Run("invalid duration set in paused step", func(t *testing.T) {
pauseDuration := intstr.FromInt(-1)
invalidRo := ro.DeepCopy()
Expand Down

0 comments on commit 0d4677b

Please sign in to comment.