mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 01:23:48 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user