-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for zero weighted services in a route #10428
Conversation
[test] again |
LGTM [test] |
@@ -46,7 +46,7 @@ func ValidateRoute(route *routeapi.Route) field.ErrorList { | |||
if route.Spec.To.Kind != "Service" { | |||
result = append(result, field.Invalid(specPath.Child("to", "kind"), route.Spec.To.Kind, "must reference a Service")) | |||
} | |||
if route.Spec.To.Weight != nil && (*route.Spec.To.Weight < 1 || *route.Spec.To.Weight > 256) { | |||
if route.Spec.To.Weight != nil && (*route.Spec.To.Weight < 0 || *route.Spec.To.Weight > 256) { | |||
result = append(result, field.Invalid(specPath.Child("to", "weight"), route.Spec.To.Weight, "weight must be an integer between 1 and 256")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: error message still says 1-256
.
@rajatchopra tests possibly are failing due to the check - use |
ec8f26a
to
cb70609
Compare
b02d089
to
72af619
Compare
72af619
to
e7cd87e
Compare
[test] again |
[test] |
Evaluated for origin test up to e7cd87e |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8040/) |
LGTM |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8040/) (Image: devenv-rhel7_4857) |
Evaluated for origin merge up to e7cd87e |
API change approved |
Issue #10279
Both 'to' and 'alternateBackends' can now point to a service with '0' as the weight. Any service with '0' weight will not have its servers listed as backends to the haproxy router. This means that one can disable a route completely by having all its services with a weight '0'. The config may still catch the request but with none of the backends existing it will result in a 503.
[test]