"description":"name for the port that can be referred to by services; must be a DNS_LABEL and unique without the pod"
"description":"name for the port that can be referred to by services; must be a IANA_SVC_NAME and unique within the pod"
},
},
"hostPort":{
"hostPort":{
"type":"integer",
"type":"integer",
...
@@ -12529,7 +12529,7 @@
...
@@ -12529,7 +12529,7 @@
},
},
"port":{
"port":{
"type":"string",
"type":"string",
"description":"number or name of the port to access on the container"
"description":"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
},
},
"host":{
"host":{
"type":"string",
"type":"string",
...
@@ -12545,7 +12545,7 @@
...
@@ -12545,7 +12545,7 @@
"properties":{
"properties":{
"port":{
"port":{
"type":"string",
"type":"string",
"description":"number of name of the port to access on the container"
"description":"number of name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
}
}
}
}
},
},
...
@@ -13264,7 +13264,7 @@
...
@@ -13264,7 +13264,7 @@
},
},
"targetPort":{
"targetPort":{
"type":"string",
"type":"string",
"description":"the port to access on the pods targeted by the service; defaults to the service port"
"description":"number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
"description":"name for the port that can be referred to by services; must be a DNS_LABEL and unique without the pod"
"description":"name for the port that can be referred to by services; must be a IANA_SVC_NAME and unique within the pod"
},
},
"hostPort":{
"hostPort":{
"type":"integer",
"type":"integer",
...
@@ -12531,7 +12531,7 @@
...
@@ -12531,7 +12531,7 @@
},
},
"port":{
"port":{
"type":"string",
"type":"string",
"description":"number or name of the port to access on the container"
"description":"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
},
},
"host":{
"host":{
"type":"string",
"type":"string",
...
@@ -12547,7 +12547,7 @@
...
@@ -12547,7 +12547,7 @@
"properties":{
"properties":{
"port":{
"port":{
"type":"string",
"type":"string",
"description":"number of name of the port to access on the container"
"description":"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
}
}
}
}
},
},
...
@@ -13270,7 +13270,7 @@
...
@@ -13270,7 +13270,7 @@
},
},
"targetPort":{
"targetPort":{
"type":"string",
"type":"string",
"description":"the port to access on the pods targeted by the service; defaults to the service port"
"description":"number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"
// IANA_SVC_NAME: This is a string, no more than 15 characters long, that
// conforms to the definition of IANA service name in RFC 6335.
// It must contains at least one letter [a-z] and it must contains only [a-z0-9-].
// Hypens ('-') cannot be leading or trailing character of the string
// and cannot be adjacent to other hyphens.
// TypeMeta describes an individual object in an API response or request
// TypeMeta describes an individual object in an API response or request
// with strings representing the type of the object and its API schema version.
// with strings representing the type of the object and its API schema version.
...
@@ -555,9 +561,9 @@ type ISCSIVolumeSource struct {
...
@@ -555,9 +561,9 @@ type ISCSIVolumeSource struct {
// ContainerPort represents a network port in a single container.
// ContainerPort represents a network port in a single container.
typeContainerPortstruct{
typeContainerPortstruct{
// Optional: If specified, this must be a DNS_LABEL. Each named port
// Optional: If specified, this must be a IANA_SVC_NAME Each named port
// in a pod must have a unique name.
// in a pod must have a unique name.
Namestring`json:"name,omitempty" description:"name for the port that can be referred to by services; must be a DNS_LABEL and unique without the pod"`
Namestring`json:"name,omitempty" description:"name for the port that can be referred to by services; must be a IANA_SVC_NAME and unique within the pod"`
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
// If HostNetwork is specified, this must match ContainerPort.
HostPortint`json:"hostPort,omitempty" description:"number of port to expose on the host; most containers do not need this"`
HostPortint`json:"hostPort,omitempty" description:"number of port to expose on the host; most containers do not need this"`
...
@@ -615,7 +621,7 @@ type HTTPGetAction struct {
...
@@ -615,7 +621,7 @@ type HTTPGetAction struct {
// Optional: Path to access on the HTTP server.
// Optional: Path to access on the HTTP server.
Pathstring`json:"path,omitempty" description:"path to access on the HTTP server"`
Pathstring`json:"path,omitempty" description:"path to access on the HTTP server"`
// Required: Name or number of the port to access on the container.
// Required: Name or number of the port to access on the container.
Portutil.IntOrString`json:"port" description:"number or name of the port to access on the container"`
Portutil.IntOrString`json:"port" description:"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
// Optional: Host name to connect to, defaults to the pod IP.
// Optional: Host name to connect to, defaults to the pod IP.
Hoststring`json:"host,omitempty" description:"hostname to connect to; defaults to pod IP"`
Hoststring`json:"host,omitempty" description:"hostname to connect to; defaults to pod IP"`
}
}
...
@@ -623,7 +629,7 @@ type HTTPGetAction struct {
...
@@ -623,7 +629,7 @@ type HTTPGetAction struct {
// TCPSocketAction describes an action based on opening a socket
// TCPSocketAction describes an action based on opening a socket
typeTCPSocketActionstruct{
typeTCPSocketActionstruct{
// Required: Port to connect to.
// Required: Port to connect to.
Portutil.IntOrString`json:"port" description:"number of name of the port to access on the container"`
Portutil.IntOrString`json:"port" description:"number of name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
}
}
// ExecAction describes a "run in container" action.
// ExecAction describes a "run in container" action.
...
@@ -1132,7 +1138,7 @@ type ServicePort struct {
...
@@ -1132,7 +1138,7 @@ type ServicePort struct {
// If this is a string, it will be looked up as a named port in the
// If this is a string, it will be looked up as a named port in the
// target Pod's container ports. If this is not specified, the value
// target Pod's container ports. If this is not specified, the value
// of Port is used (an identity map).
// of Port is used (an identity map).
TargetPortutil.IntOrString`json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"`
TargetPortutil.IntOrString`json:"targetPort,omitempty" description:"number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
// The port on each node on which this service is exposed.
// The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
// IANA_SVC_NAME: This is a string, no more than 15 characters long, that
// conforms to the definition of IANA service name in RFC 6335.
// It must contains at least one letter [a-z] and it must contains only [a-z0-9-].
// Hypens ('-') cannot be leading or trailing character of the string
// and cannot be adjacent to other hyphens.
// TypeMeta describes an individual object in an API response or request
// TypeMeta describes an individual object in an API response or request
// with strings representing the type of the object and its API schema version.
// with strings representing the type of the object and its API schema version.
...
@@ -555,9 +561,9 @@ type ISCSIVolumeSource struct {
...
@@ -555,9 +561,9 @@ type ISCSIVolumeSource struct {
// ContainerPort represents a network port in a single container.
// ContainerPort represents a network port in a single container.
typeContainerPortstruct{
typeContainerPortstruct{
// Optional: If specified, this must be a DNS_LABEL. Each named port
// Optional: If specified, this must be a IANA_SVC_NAME. Each named port
// in a pod must have a unique name.
// in a pod must have a unique name.
Namestring`json:"name,omitempty" description:"name for the port that can be referred to by services; must be a DNS_LABEL and unique without the pod"`
Namestring`json:"name,omitempty" description:"name for the port that can be referred to by services; must be a IANA_SVC_NAME and unique within the pod"`
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
// If HostNetwork is specified, this must match ContainerPort.
HostPortint`json:"hostPort,omitempty" description:"number of port to expose on the host; most containers do not need this"`
HostPortint`json:"hostPort,omitempty" description:"number of port to expose on the host; most containers do not need this"`
...
@@ -615,7 +621,7 @@ type HTTPGetAction struct {
...
@@ -615,7 +621,7 @@ type HTTPGetAction struct {
// Optional: Path to access on the HTTP server.
// Optional: Path to access on the HTTP server.
Pathstring`json:"path,omitempty" description:"path to access on the HTTP server"`
Pathstring`json:"path,omitempty" description:"path to access on the HTTP server"`
// Required: Name or number of the port to access on the container.
// Required: Name or number of the port to access on the container.
Portutil.IntOrString`json:"port" description:"number or name of the port to access on the container"`
Portutil.IntOrString`json:"port" description:"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
// Optional: Host name to connect to, defaults to the pod IP.
// Optional: Host name to connect to, defaults to the pod IP.
Hoststring`json:"host,omitempty" description:"hostname to connect to; defaults to pod IP"`
Hoststring`json:"host,omitempty" description:"hostname to connect to; defaults to pod IP"`
}
}
...
@@ -623,7 +629,7 @@ type HTTPGetAction struct {
...
@@ -623,7 +629,7 @@ type HTTPGetAction struct {
// TCPSocketAction describes an action based on opening a socket
// TCPSocketAction describes an action based on opening a socket
typeTCPSocketActionstruct{
typeTCPSocketActionstruct{
// Required: Port to connect to.
// Required: Port to connect to.
Portutil.IntOrString`json:"port" description:"number of name of the port to access on the container"`
Portutil.IntOrString`json:"port" description:"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
}
}
// ExecAction describes a "run in container" action.
// ExecAction describes a "run in container" action.
...
@@ -1138,7 +1144,7 @@ type ServicePort struct {
...
@@ -1138,7 +1144,7 @@ type ServicePort struct {
// If this is a string, it will be looked up as a named port in the
// If this is a string, it will be looked up as a named port in the
// target Pod's container ports. If this is not specified, the value
// target Pod's container ports. If this is not specified, the value
// of Port is used (an identity map).
// of Port is used (an identity map).
TargetPortutil.IntOrString`json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"`
TargetPortutil.IntOrString`json:"targetPort,omitempty" description:"number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"`
// The port on each node on which this service is exposed.
// The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
@@ -49,6 +49,7 @@ var dns1123LabelErrorMsg string = fmt.Sprintf(`must be a DNS label (at most %d c
...
@@ -49,6 +49,7 @@ var dns1123LabelErrorMsg string = fmt.Sprintf(`must be a DNS label (at most %d c
vardns952LabelErrorMsgstring=fmt.Sprintf(`must be a DNS 952 label (at most %d characters, matching regex %s): e.g. "my-name"`,util.DNS952LabelMaxLength,util.DNS952LabelFmt)
vardns952LabelErrorMsgstring=fmt.Sprintf(`must be a DNS 952 label (at most %d characters, matching regex %s): e.g. "my-name"`,util.DNS952LabelMaxLength,util.DNS952LabelFmt)
varportNameErrorMsgstring=fmt.Sprintf(`must be a IANA_SVC_NAME (at most 15 characters, matching regex %s and it must containts at least one letter [a-z], hypens cannot be adjacent to other hyphens): e.g. "http"`,util.IdentifierNoHyphensBeginEndFmt)
"name not a DNS label":{[]api.ContainerPort{{Name:"a.b.c",ContainerPort:80,Protocol:"TCP"}},errors.ValidationErrorTypeInvalid,"[0].name",dns1123LabelErrorMsg},
"name not a IANA svc name ":{[]api.ContainerPort{{Name:"a.b.c",ContainerPort:80,Protocol:"TCP"}},errors.ValidationErrorTypeInvalid,"[0].name",portNameErrorMsg},
"name not a IANA svc name (i.e. a number)":{[]api.ContainerPort{{Name:"80",ContainerPort:80,Protocol:"TCP"}},errors.ValidationErrorTypeInvalid,"[0].name",portNameErrorMsg},