To add validation for service ports when defined as string (fixing issue #9734)

This commit is contained in:
Salvatore Dario Minonne
2015-06-12 18:33:11 +02:00
parent ff0546da4f
commit 4b13faa346
13 changed files with 193 additions and 94 deletions

View File

@@ -155,7 +155,7 @@ func (c *Controller) CreateMasterServiceIfNeeded(serviceName string, serviceIP n
Labels: map[string]string{"provider": "kubernetes", "component": "apiserver"},
},
Spec: api.ServiceSpec{
Ports: []api.ServicePort{{Port: servicePort, Protocol: api.ProtocolTCP}},
Ports: []api.ServicePort{{Port: servicePort, Protocol: api.ProtocolTCP, TargetPort: util.NewIntOrStringFromInt(servicePort)}},
// maintained by this code, not by the pod selector
Selector: nil,
ClusterIP: serviceIP.String(),