make PodIP.IP and HostIP.IP required.

Fields used as map keys must be required or defaulted when used in a CRD schema.

see https://github.com/kubernetes/kubernetes/issues/124540

Signed-off-by: Lan Liang <gcslyp@gmail.com>
This commit is contained in:
Lan Liang 2024-05-16 08:36:27 +00:00 committed by Tim Hockin
parent bae59799e9
commit 73613b48c6
No known key found for this signature in database
6 changed files with 26 additions and 2 deletions

View File

@ -7482,6 +7482,9 @@
"type": "string"
}
},
"required": [
"ip"
],
"type": "object"
},
"io.k8s.api.core.v1.HostPathVolumeSource": {
@ -9293,6 +9296,9 @@
"type": "string"
}
},
"required": [
"ip"
],
"type": "object"
},
"io.k8s.api.core.v1.PodList": {

View File

@ -2814,10 +2814,14 @@
"description": "HostIP represents a single IP address allocated to the host.",
"properties": {
"ip": {
"default": "",
"description": "IP is the IP address assigned to the host",
"type": "string"
}
},
"required": [
"ip"
],
"type": "object"
},
"io.k8s.api.core.v1.HostPathVolumeSource": {
@ -5165,10 +5169,14 @@
"description": "PodIP represents a single IP address allocated to the pod.",
"properties": {
"ip": {
"default": "",
"description": "IP is the IP address assigned to the pod",
"type": "string"
}
},
"required": [
"ip"
],
"type": "object"
},
"io.k8s.api.core.v1.PodList": {

View File

@ -23024,11 +23024,13 @@ func schema_k8sio_api_core_v1_HostIP(ref common.ReferenceCallback) common.OpenAP
"ip": {
SchemaProps: spec.SchemaProps{
Description: "IP is the IP address assigned to the host",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"ip"},
},
},
}
@ -26744,11 +26746,13 @@ func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPI
"ip": {
SchemaProps: spec.SchemaProps{
Description: "IP is the IP address assigned to the pod",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"ip"},
},
},
}

View File

@ -1990,6 +1990,7 @@ message HostAlias {
// HostIP represents a single IP address allocated to the host.
message HostIP {
// IP is the IP address assigned to the host
// +required
optional string ip = 1;
}
@ -3702,6 +3703,7 @@ message PodExecOptions {
// PodIP represents a single IP address allocated to the pod.
message PodIP {
// IP is the IP address assigned to the pod
// +required
optional string ip = 1;
}

View File

@ -4424,13 +4424,15 @@ type PodDNSConfigOption struct {
// PodIP represents a single IP address allocated to the pod.
type PodIP struct {
// IP is the IP address assigned to the pod
IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
// +required
IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
}
// HostIP represents a single IP address allocated to the host.
type HostIP struct {
// IP is the IP address assigned to the host
IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
// +required
IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
}
// EphemeralContainerCommon is a copy of all fields in Container to be inlined in

View File

@ -5665,6 +5665,7 @@ var schemaYAML = typed.YAMLObject(`types:
- name: ip
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.HostPathVolumeSource
map:
fields:
@ -6770,6 +6771,7 @@ var schemaYAML = typed.YAMLObject(`types:
- name: ip
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.PodOS
map:
fields: