Skip to content

Commit e6b4451

Browse files
pmalekjingczhang
authored andcommitted
fix(api): make LocalObjectReference.Name and HostAlias.IP required (kubernetes#124553)
* fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required * chore(api): add LocalObjectReference comment * chore(api): add omitempty to LocalObjectReference's Name * chore(api): add kubebuilder:default annotation * chore(api): ./hack/update-codegen.sh
1 parent 5ad993e commit e6b4451

File tree

9 files changed

+116
-44
lines changed

9 files changed

+116
-44
lines changed

api/openapi-spec/swagger.json

+11-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/api__v1_openapi.json

+20-8
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,8 @@
955955
"description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.",
956956
"properties": {
957957
"name": {
958-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
958+
"default": "",
959+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
959960
"type": "string"
960961
},
961962
"optional": {
@@ -974,7 +975,8 @@
974975
"type": "string"
975976
},
976977
"name": {
977-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
978+
"default": "",
979+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
978980
"type": "string"
979981
},
980982
"optional": {
@@ -1084,7 +1086,8 @@
10841086
"x-kubernetes-list-type": "atomic"
10851087
},
10861088
"name": {
1087-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1089+
"default": "",
1090+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
10881091
"type": "string"
10891092
},
10901093
"optional": {
@@ -1116,7 +1119,8 @@
11161119
"x-kubernetes-list-type": "atomic"
11171120
},
11181121
"name": {
1119-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1122+
"default": "",
1123+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
11201124
"type": "string"
11211125
},
11221126
"optional": {
@@ -2784,10 +2788,14 @@
27842788
"x-kubernetes-list-type": "atomic"
27852789
},
27862790
"ip": {
2791+
"default": "",
27872792
"description": "IP address of the host file entry.",
27882793
"type": "string"
27892794
}
27902795
},
2796+
"required": [
2797+
"ip"
2798+
],
27912799
"type": "object"
27922800
},
27932801
"io.k8s.api.core.v1.HostIP": {
@@ -3248,7 +3256,8 @@
32483256
"description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
32493257
"properties": {
32503258
"name": {
3251-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
3259+
"default": "",
3260+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
32523261
"type": "string"
32533262
}
32543263
},
@@ -6934,7 +6943,8 @@
69346943
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
69356944
"properties": {
69366945
"name": {
6937-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
6946+
"default": "",
6947+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
69386948
"type": "string"
69396949
},
69406950
"optional": {
@@ -6953,7 +6963,8 @@
69536963
"type": "string"
69546964
},
69556965
"name": {
6956-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
6966+
"default": "",
6967+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
69576968
"type": "string"
69586969
},
69596970
"optional": {
@@ -7029,7 +7040,8 @@
70297040
"x-kubernetes-list-type": "atomic"
70307041
},
70317042
"name": {
7032-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
7043+
"default": "",
7044+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
70337045
"type": "string"
70347046
},
70357047
"optional": {

api/openapi-spec/v3/apis__apps__v1_openapi.json

+20-8
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,8 @@
16631663
"description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.",
16641664
"properties": {
16651665
"name": {
1666-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1666+
"default": "",
1667+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
16671668
"type": "string"
16681669
},
16691670
"optional": {
@@ -1682,7 +1683,8 @@
16821683
"type": "string"
16831684
},
16841685
"name": {
1685-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1686+
"default": "",
1687+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
16861688
"type": "string"
16871689
},
16881690
"optional": {
@@ -1713,7 +1715,8 @@
17131715
"x-kubernetes-list-type": "atomic"
17141716
},
17151717
"name": {
1716-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1718+
"default": "",
1719+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
17171720
"type": "string"
17181721
},
17191722
"optional": {
@@ -1745,7 +1748,8 @@
17451748
"x-kubernetes-list-type": "atomic"
17461749
},
17471750
"name": {
1748-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
1751+
"default": "",
1752+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
17491753
"type": "string"
17501754
},
17511755
"optional": {
@@ -2715,10 +2719,14 @@
27152719
"x-kubernetes-list-type": "atomic"
27162720
},
27172721
"ip": {
2722+
"default": "",
27182723
"description": "IP address of the host file entry.",
27192724
"type": "string"
27202725
}
27212726
},
2727+
"required": [
2728+
"ip"
2729+
],
27222730
"type": "object"
27232731
},
27242732
"io.k8s.api.core.v1.HostPathVolumeSource": {
@@ -2896,7 +2904,8 @@
28962904
"description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
28972905
"properties": {
28982906
"name": {
2899-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
2907+
"default": "",
2908+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
29002909
"type": "string"
29012910
}
29022911
},
@@ -4459,7 +4468,8 @@
44594468
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
44604469
"properties": {
44614470
"name": {
4462-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
4471+
"default": "",
4472+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
44634473
"type": "string"
44644474
},
44654475
"optional": {
@@ -4478,7 +4488,8 @@
44784488
"type": "string"
44794489
},
44804490
"name": {
4481-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
4491+
"default": "",
4492+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
44824493
"type": "string"
44834494
},
44844495
"optional": {
@@ -4509,7 +4520,8 @@
45094520
"x-kubernetes-list-type": "atomic"
45104521
},
45114522
"name": {
4512-
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
4523+
"default": "",
4524+
"description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
45134525
"type": "string"
45144526
},
45154527
"optional": {

0 commit comments

Comments
 (0)