Svc REST: Set Cluster IPs during dry-run Create

Dry-run should behave like a real API call and return valid results.
This commit is contained in:
Tim Hockin
2020-11-25 15:28:35 -08:00
parent 52856f3fbe
commit e338c9db4b
4 changed files with 149 additions and 146 deletions

View File

@@ -192,6 +192,13 @@ func SetAllocateLoadBalancerNodePorts(val bool) Tweak {
}
}
// SetUniqueNodePorts sets all nodeports to unique values.
func SetUniqueNodePorts(svc *api.Service) {
for i := range svc.Spec.Ports {
svc.Spec.Ports[i].NodePort = int32(30000 + i)
}
}
// SetHealthCheckNodePort sets the healthCheckNodePort field for a Service.
func SetHealthCheckNodePort(value int32) Tweak {
return func(svc *api.Service) {