Change the v1b3 default for service ContainerPort

In v1b1 and v1b2 we choose the "first defined port" if you do not specify a
ContainerPort.  I am proposing that v1b3 just assume the ContainerPort is the
same as the service port unless explicitly provided.  This leaves named ports
for now, but that is under discussion on its own.

This is strictly compatible, though to implement this we have to leave the
internal objects with the looser behavior until v1b[12] die.  This also adds a
link dependency so that when we DO kill v1b[12] the endpoints controller will
blow up, prompting a fix.
This commit is contained in:
Tim Hockin
2015-03-01 13:34:57 -08:00
parent 3beca3a4e8
commit 5aadd6ecae
8 changed files with 65 additions and 1 deletions

View File

@@ -724,6 +724,8 @@ type ServiceSpec struct {
// ContainerPort is the name or number of the port on the container to direct traffic to.
// This is useful if the containers the service points to have multiple open ports.
// Optional: If unspecified, the first port on the container will be used.
// As of v1beta3 this field will become required in the internal API,
// and the versioned APIs must provide a default value.
ContainerPort util.IntOrString `json:"containerPort,omitempty"`
// Required: Supports "ClientIP" and "None". Used to maintain session affinity.