mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #94182 from mattfenwick/issue-94088
modify DNS-1123 error messages to indicate that RFC 1123 is not followed exactly
This commit is contained in:
commit
e077b0ffa4
8
api/openapi-spec/swagger.json
generated
8
api/openapi-spec/swagger.json
generated
@ -9984,7 +9984,7 @@
|
||||
"type": "array"
|
||||
},
|
||||
"externalName": {
|
||||
"description": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.",
|
||||
"description": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.",
|
||||
"type": "string"
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
@ -10593,7 +10593,7 @@
|
||||
"description": "conditions contains information about the current status of the endpoint."
|
||||
},
|
||||
"hostname": {
|
||||
"description": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) validation.",
|
||||
"description": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.",
|
||||
"type": "string"
|
||||
},
|
||||
"targetRef": {
|
||||
@ -12591,7 +12591,7 @@
|
||||
"description": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature."
|
||||
},
|
||||
"runtimeHandler": {
|
||||
"description": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements and is immutable.",
|
||||
"description": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"type": "string"
|
||||
},
|
||||
"scheduling": {
|
||||
@ -12646,7 +12646,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"handler": {
|
||||
"description": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"description": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
|
@ -693,7 +693,7 @@ func TestValidateValidatingWebhookConfiguration(t *testing.T) {
|
||||
SideEffects: &unknownSideEffect,
|
||||
},
|
||||
}, true),
|
||||
expectedError: `clientConfig.service.path: Invalid value: "/apis/foo.bar/v1alpha1/--bad": segment[3]: a DNS-1123 subdomain`,
|
||||
expectedError: `clientConfig.service.path: Invalid value: "/apis/foo.bar/v1alpha1/--bad": segment[3]: a lowercase RFC 1123 subdomain`,
|
||||
},
|
||||
{
|
||||
name: "invalid port 0",
|
||||
@ -1662,7 +1662,7 @@ func TestValidateMutatingWebhookConfiguration(t *testing.T) {
|
||||
SideEffects: &unknownSideEffect,
|
||||
},
|
||||
}, true),
|
||||
expectedError: `clientConfig.service.path: Invalid value: "/apis/foo.bar/v1alpha1/--bad": segment[3]: a DNS-1123 subdomain`,
|
||||
expectedError: `clientConfig.service.path: Invalid value: "/apis/foo.bar/v1alpha1/--bad": segment[3]: a lowercase RFC 1123 subdomain`,
|
||||
},
|
||||
{
|
||||
name: "invalid port 0",
|
||||
|
@ -153,7 +153,7 @@ func TestValidateCertificateSigningRequestCreate(t *testing.T) {
|
||||
},
|
||||
},
|
||||
errs: field.ErrorList{
|
||||
field.Invalid(specPath.Child("signerName"), "", `validating label "": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
field.Invalid(specPath.Child("signerName"), "", `validating label "": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
},
|
||||
},
|
||||
"signerName path component ends with a symbol": {
|
||||
@ -166,7 +166,7 @@ func TestValidateCertificateSigningRequestCreate(t *testing.T) {
|
||||
},
|
||||
},
|
||||
errs: field.ErrorList{
|
||||
field.Invalid(specPath.Child("signerName"), "something-", `validating label "something-": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
field.Invalid(specPath.Child("signerName"), "something-", `validating label "something-": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
},
|
||||
},
|
||||
"signerName path component is a symbol": {
|
||||
@ -179,7 +179,7 @@ func TestValidateCertificateSigningRequestCreate(t *testing.T) {
|
||||
},
|
||||
},
|
||||
errs: field.ErrorList{
|
||||
field.Invalid(specPath.Child("signerName"), "-", `validating label "-": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
field.Invalid(specPath.Child("signerName"), "-", `validating label "-": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
},
|
||||
},
|
||||
"signerName path component contains no '.' but is valid": {
|
||||
|
@ -41,8 +41,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
dnsLabelErrMsg = "a DNS-1123 label must consist of"
|
||||
dnsSubdomainLabelErrMsg = "a DNS-1123 subdomain"
|
||||
dnsLabelErrMsg = "a lowercase RFC 1123 label must consist of"
|
||||
dnsSubdomainLabelErrMsg = "a lowercase RFC 1123 subdomain"
|
||||
envVarNameErrMsg = "a valid environment variable name must consist of"
|
||||
)
|
||||
|
||||
|
@ -614,7 +614,7 @@ func TestFlowSchemaValidation(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expectedErrors: field.ErrorList{
|
||||
field.Invalid(field.NewPath("spec").Child("priorityLevelConfiguration").Child("name"), "system+++$$", `a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
field.Invalid(field.NewPath("spec").Child("priorityLevelConfiguration").Child("name"), "system+++$$", `a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`),
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -857,7 +857,7 @@ func TestFlowSchemaValidation(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expectedErrors: field.ErrorList{
|
||||
field.Invalid(field.NewPath("spec").Child("rules").Index(0).Child("resourceRules").Index(0).Child("namespaces").Index(0), "-foo", nsErrIntro+`a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')`),
|
||||
field.Invalid(field.NewPath("spec").Child("rules").Index(0).Child("resourceRules").Index(0).Child("namespaces").Index(0), "-foo", nsErrIntro+`a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')`),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -1391,7 +1391,7 @@ func TestValidateIngressCreate(t *testing.T) {
|
||||
tweakIngress: func(ingress *networking.Ingress) {
|
||||
ingress.Spec.TLS = []networking.IngressTLS{{SecretName: "invalid name"}}
|
||||
},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec").Child("tls").Index(0).Child("secretName"), "invalid name", `a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`)},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec").Child("tls").Index(0).Child("secretName"), "invalid name", `a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`)},
|
||||
},
|
||||
"v1beta1: valid secret": {
|
||||
groupVersion: &networkingv1beta1.SchemeGroupVersion,
|
||||
@ -1821,7 +1821,7 @@ func TestValidateIngressUpdate(t *testing.T) {
|
||||
oldIngress.Spec.TLS = []networking.IngressTLS{{SecretName: "valid"}}
|
||||
newIngress.Spec.TLS = []networking.IngressTLS{{SecretName: "invalid name"}}
|
||||
},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec").Child("tls").Index(0).Child("secretName"), "invalid name", `a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`)},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec").Child("tls").Index(0).Child("secretName"), "invalid name", `a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')`)},
|
||||
},
|
||||
"v1: change invalid secret -> invalid secret": {
|
||||
gv: networkingv1.SchemeGroupVersion,
|
||||
@ -2017,7 +2017,7 @@ func TestValidateIngressClass(t *testing.T) {
|
||||
Controller: "foo.co/bar",
|
||||
},
|
||||
},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("metadata.name"), "test*123", "a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")},
|
||||
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("metadata.name"), "test*123", "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")},
|
||||
},
|
||||
"valid name, empty controller": {
|
||||
ingressClass: networking.IngressClass{
|
||||
|
@ -4852,7 +4852,7 @@ message ServiceSpec {
|
||||
|
||||
// externalName is the external reference that kubedns or equivalent will
|
||||
// return as a CNAME record for this service. No proxying will be involved.
|
||||
// Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123)
|
||||
// Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123)
|
||||
// and requires Type to be ExternalName.
|
||||
// +optional
|
||||
optional string externalName = 10;
|
||||
|
@ -4068,7 +4068,7 @@ type ServiceSpec struct {
|
||||
|
||||
// externalName is the external reference that kubedns or equivalent will
|
||||
// return as a CNAME record for this service. No proxying will be involved.
|
||||
// Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123)
|
||||
// Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123)
|
||||
// and requires Type to be ExternalName.
|
||||
// +optional
|
||||
ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"`
|
||||
|
@ -2235,7 +2235,7 @@ var map_ServiceSpec = map[string]string{
|
||||
"sessionAffinity": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies",
|
||||
"loadBalancerIP": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.",
|
||||
"loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/",
|
||||
"externalName": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.",
|
||||
"externalName": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.",
|
||||
"externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.",
|
||||
"healthCheckNodePort": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.",
|
||||
"publishNotReadyAddresses": "publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered \"ready\" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior.",
|
||||
|
@ -45,8 +45,8 @@ message Endpoint {
|
||||
// hostname of this endpoint. This field may be used by consumers of
|
||||
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
|
||||
// Multiple endpoints which use the same hostname should be considered
|
||||
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
|
||||
// validation.
|
||||
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass
|
||||
// DNS label (RFC 1123) validation.
|
||||
// +optional
|
||||
optional string hostname = 3;
|
||||
|
||||
|
@ -86,8 +86,8 @@ type Endpoint struct {
|
||||
// hostname of this endpoint. This field may be used by consumers of
|
||||
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
|
||||
// Multiple endpoints which use the same hostname should be considered
|
||||
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
|
||||
// validation.
|
||||
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass
|
||||
// DNS label (RFC 1123) validation.
|
||||
// +optional
|
||||
Hostname *string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
|
||||
// targetRef is a reference to a Kubernetes object that represents this
|
||||
|
@ -31,7 +31,7 @@ var map_Endpoint = map[string]string{
|
||||
"": "Endpoint represents a single logical \"backend\" implementing a service.",
|
||||
"addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.",
|
||||
"conditions": "conditions contains information about the current status of the endpoint.",
|
||||
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) validation.",
|
||||
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS label (RFC 1123) validation.",
|
||||
"targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.",
|
||||
"topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.",
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ message Endpoint {
|
||||
// hostname of this endpoint. This field may be used by consumers of
|
||||
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
|
||||
// Multiple endpoints which use the same hostname should be considered
|
||||
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
|
||||
// validation.
|
||||
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS
|
||||
// Label (RFC 1123) validation.
|
||||
// +optional
|
||||
optional string hostname = 3;
|
||||
|
||||
|
@ -88,8 +88,8 @@ type Endpoint struct {
|
||||
// hostname of this endpoint. This field may be used by consumers of
|
||||
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
|
||||
// Multiple endpoints which use the same hostname should be considered
|
||||
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
|
||||
// validation.
|
||||
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS
|
||||
// Label (RFC 1123) validation.
|
||||
// +optional
|
||||
Hostname *string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
|
||||
// targetRef is a reference to a Kubernetes object that represents this
|
||||
|
@ -31,7 +31,7 @@ var map_Endpoint = map[string]string{
|
||||
"": "Endpoint represents a single logical \"backend\" implementing a service.",
|
||||
"addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.",
|
||||
"conditions": "conditions contains information about the current status of the endpoint.",
|
||||
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) validation.",
|
||||
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.",
|
||||
"targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.",
|
||||
"topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.",
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ message RuntimeClassSpec {
|
||||
// For example, a handler called "runc" might specify that the runc OCI
|
||||
// runtime (using native Linux containers) will be used to run the containers
|
||||
// in a pod.
|
||||
// The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements
|
||||
// and is immutable.
|
||||
// The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
|
||||
// requirements, and is immutable.
|
||||
optional string runtimeHandler = 1;
|
||||
|
||||
// Overhead represents the resource overhead associated with running a pod for a
|
||||
|
@ -56,8 +56,8 @@ type RuntimeClassSpec struct {
|
||||
// For example, a handler called "runc" might specify that the runc OCI
|
||||
// runtime (using native Linux containers) will be used to run the containers
|
||||
// in a pod.
|
||||
// The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements
|
||||
// and is immutable.
|
||||
// The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
|
||||
// requirements, and is immutable.
|
||||
RuntimeHandler string `json:"runtimeHandler" protobuf:"bytes,1,opt,name=runtimeHandler"`
|
||||
|
||||
// Overhead represents the resource overhead associated with running a pod for a
|
||||
|
@ -58,7 +58,7 @@ func (RuntimeClassList) SwaggerDoc() map[string]string {
|
||||
|
||||
var map_RuntimeClassSpec = map[string]string{
|
||||
"": "RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters that are required to describe the RuntimeClass to the Container Runtime Interface (CRI) implementation, as well as any other components that need to understand how the pod will be run. The RuntimeClassSpec is immutable.",
|
||||
"runtimeHandler": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements and is immutable.",
|
||||
"runtimeHandler": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature.",
|
||||
"scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.",
|
||||
}
|
||||
|
@ -57,8 +57,8 @@ message RuntimeClass {
|
||||
// For example, a handler called "runc" might specify that the runc OCI
|
||||
// runtime (using native Linux containers) will be used to run the containers
|
||||
// in a pod.
|
||||
// The Handler must conform to the DNS Label (RFC 1123) requirements, and is
|
||||
// immutable.
|
||||
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
|
||||
// and is immutable.
|
||||
optional string handler = 2;
|
||||
|
||||
// Overhead represents the resource overhead associated with running a pod for a
|
||||
|
@ -48,8 +48,8 @@ type RuntimeClass struct {
|
||||
// For example, a handler called "runc" might specify that the runc OCI
|
||||
// runtime (using native Linux containers) will be used to run the containers
|
||||
// in a pod.
|
||||
// The Handler must conform to the DNS Label (RFC 1123) requirements, and is
|
||||
// immutable.
|
||||
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
|
||||
// and is immutable.
|
||||
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
|
||||
|
||||
// Overhead represents the resource overhead associated with running a pod for a
|
||||
|
@ -39,7 +39,7 @@ func (Overhead) SwaggerDoc() map[string]string {
|
||||
var map_RuntimeClass = map[string]string{
|
||||
"": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md",
|
||||
"metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
|
||||
"overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature.",
|
||||
"scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.",
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ func IsValidLabelValue(value string) []string {
|
||||
}
|
||||
|
||||
const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
|
||||
const dns1123LabelErrMsg string = "a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character"
|
||||
const dns1123LabelErrMsg string = "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character"
|
||||
|
||||
// DNS1123LabelMaxLength is a label's max length in DNS (RFC 1123)
|
||||
const DNS1123LabelMaxLength int = 63
|
||||
@ -196,7 +196,7 @@ func IsDNS1123Label(value string) []string {
|
||||
}
|
||||
|
||||
const dns1123SubdomainFmt string = dns1123LabelFmt + "(\\." + dns1123LabelFmt + ")*"
|
||||
const dns1123SubdomainErrorMsg string = "a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character"
|
||||
const dns1123SubdomainErrorMsg string = "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character"
|
||||
|
||||
// DNS1123SubdomainMaxLength is a subdomain's max length in DNS (RFC 1123)
|
||||
const DNS1123SubdomainMaxLength int = 253
|
||||
|
@ -639,12 +639,12 @@ func TestIsFullyQualifiedName(t *testing.T) {
|
||||
{
|
||||
name: "name should not include scheme",
|
||||
targetName: "http://foo.k8s.io",
|
||||
err: "a DNS-1123 subdomain must consist of lower case alphanumeric characters",
|
||||
err: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters",
|
||||
},
|
||||
{
|
||||
name: "email should be invalid",
|
||||
targetName: "example@foo.k8s.io",
|
||||
err: "a DNS-1123 subdomain must consist of lower case alphanumeric characters",
|
||||
err: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters",
|
||||
},
|
||||
{
|
||||
name: "name cannot be empty",
|
||||
@ -654,7 +654,7 @@ func TestIsFullyQualifiedName(t *testing.T) {
|
||||
{
|
||||
name: "name must conform to RFC 1123",
|
||||
targetName: "A.B.C",
|
||||
err: "a DNS-1123 subdomain must consist of lower case alphanumeric characters",
|
||||
err: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters",
|
||||
},
|
||||
}
|
||||
for _, tc := range messageTests {
|
||||
|
Loading…
Reference in New Issue
Block a user