diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 22c8651285f..72bef7dceeb 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -465,6 +465,9 @@ "description": "spec defines the desired behavior of the ValidatingAdmissionPolicyBinding." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -1694,6 +1697,11 @@ "x-kubernetes-list-type": "set" } }, + "required": [ + "apiServerID", + "encodingVersion", + "decodableVersions" + ], "type": "object" }, "io.k8s.api.apiserverinternal.v1alpha1.StorageVersion": { @@ -1721,8 +1729,7 @@ } }, "required": [ - "spec", - "status" + "metadata" ], "type": "object", "x-kubernetes-group-version-kind": [ @@ -3558,6 +3565,9 @@ "description": "status is the current information about the autoscaler." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -3907,6 +3917,9 @@ "description": "status is the current information about the autoscaler." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -4350,6 +4363,9 @@ "description": "Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -5506,6 +5522,9 @@ "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -5605,6 +5624,9 @@ "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -13666,6 +13688,9 @@ "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -14423,6 +14448,9 @@ "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json index 1a12ce0d042..6fca0348f26 100644 --- a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json @@ -580,6 +580,9 @@ "description": "spec defines the desired behavior of the ValidatingAdmissionPolicyBinding." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json b/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json index 9b42ce8dca7..805e62c6c9f 100644 --- a/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json +++ b/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json @@ -65,6 +65,9 @@ "description": "status is the current information about the autoscaler." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json b/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json index 5a40c5f72f6..fe8605b46b2 100644 --- a/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json +++ b/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json @@ -244,6 +244,9 @@ "description": "status is the current information about the autoscaler." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__batch__v1_openapi.json b/api/openapi-spec/v3/apis__batch__v1_openapi.json index 23731e7eefc..47c2ca5635f 100644 --- a/api/openapi-spec/v3/apis__batch__v1_openapi.json +++ b/api/openapi-spec/v3/apis__batch__v1_openapi.json @@ -40,6 +40,9 @@ "description": "Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__coordination.k8s.io__v1alpha2_openapi.json b/api/openapi-spec/v3/apis__coordination.k8s.io__v1alpha2_openapi.json index f0cc5acb856..663b8fb0c65 100644 --- a/api/openapi-spec/v3/apis__coordination.k8s.io__v1alpha2_openapi.json +++ b/api/openapi-spec/v3/apis__coordination.k8s.io__v1alpha2_openapi.json @@ -31,6 +31,9 @@ "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__coordination.k8s.io__v1beta1_openapi.json b/api/openapi-spec/v3/apis__coordination.k8s.io__v1beta1_openapi.json index 219c3d707d1..170190568ae 100644 --- a/api/openapi-spec/v3/apis__coordination.k8s.io__v1beta1_openapi.json +++ b/api/openapi-spec/v3/apis__coordination.k8s.io__v1beta1_openapi.json @@ -31,6 +31,9 @@ "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json index 7036d201a7e..fee3b5410be 100644 --- a/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json @@ -31,6 +31,11 @@ "x-kubernetes-list-type": "set" } }, + "required": [ + "apiServerID", + "encodingVersion", + "decodableVersions" + ], "type": "object" }, "io.k8s.api.apiserverinternal.v1alpha1.StorageVersion": { @@ -73,8 +78,7 @@ } }, "required": [ - "spec", - "status" + "metadata" ], "type": "object", "x-kubernetes-group-version-kind": [ diff --git a/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json index 2d7ab9807b6..de5a1068241 100644 --- a/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json @@ -105,6 +105,9 @@ "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json b/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json index aedcc995cf9..17d7cd88d8a 100644 --- a/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json +++ b/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json @@ -31,6 +31,9 @@ "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { diff --git a/hack/golangci-hints.yaml b/hack/golangci-hints.yaml index 730ca6416c7..136686f509d 100644 --- a/hack/golangci-hints.yaml +++ b/hack/golangci-hints.yaml @@ -213,8 +213,9 @@ linters: path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go" # OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags. - - text: "must be marked as optional or required" - path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage|storagemigration)" + # The nonpointerstructs linter is included here as well as these two should be enabled hand-in-hand on each API group. + - text: "must be marked as optional or required|is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/(admission|apidiscovery|apps|authentication|authorization|autoscaling|batch|certificates|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage)" # OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed. - text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required" @@ -223,6 +224,13 @@ linters: # jsontags: 'Port' must be capitalized for backward compatibility - text: 'jsontags: field DaemonEndpoint.Port json tag does not match' path: "staging/src/k8s.io/api/core/v1/types.go" + + # NonPointerStructs - Existing fields that are non-pointer structs but where the current rules are incorrect. + + # The PodGroup.Policy field is a union type, but is not marked up as a union, nor does nonpointerstructs understand unions today. + # Validation makes this require at least one of the fields within to be set. + - text: "nonpointerstructs: field PodGroup.Policy is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/scheduling/v1alpha1/types.go" - linters: - forbidigo @@ -405,6 +413,7 @@ linters: # - "nobools" # Bools do not evolve over time, should use enums instead. # - "nofloats" # Ensure floats are not used. - "nomaps" # Ensure maps are not used, unless they are `map[string]string` (for labels/annotations/etc). + - "nonpointerstructs" # Ensure non-pointer structs are correctly tagged as optional or required. - "nonullable" # Ensure fields are not marked as nullable. # - "nophase" # Ensure field names do not have the word "phase" in them. - "notimestamp" # Ensure fields are not named "timestamp", prefer "time". @@ -444,7 +453,6 @@ linters: # nomaps: # policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed. # optionalFields: - # policy: AllowOptionalFields # Determines how the linter should handle optional fields.optionalfields: # pointers: # preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`. # policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`. @@ -455,7 +463,6 @@ linters: # optionalOrRequired: # preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`. # preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`. - # policy: AllowOptionalFields # Determines how the linter should handle optional fields. # requiredFields: # pointers: # policy: SuggestFix | Warn # The policy for pointers in required fields. Defaults to `SuggestFix`. diff --git a/hack/golangci.yaml b/hack/golangci.yaml index f6988d1d73b..26bf20e9857 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -224,8 +224,9 @@ linters: path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go" # OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags. - - text: "must be marked as optional or required" - path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage|storagemigration)" + # The nonpointerstructs linter is included here as well as these two should be enabled hand-in-hand on each API group. + - text: "must be marked as optional or required|is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/(admission|apidiscovery|apps|authentication|authorization|autoscaling|batch|certificates|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage)" # OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed. - text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required" @@ -234,6 +235,13 @@ linters: # jsontags: 'Port' must be capitalized for backward compatibility - text: 'jsontags: field DaemonEndpoint.Port json tag does not match' path: "staging/src/k8s.io/api/core/v1/types.go" + + # NonPointerStructs - Existing fields that are non-pointer structs but where the current rules are incorrect. + + # The PodGroup.Policy field is a union type, but is not marked up as a union, nor does nonpointerstructs understand unions today. + # Validation makes this require at least one of the fields within to be set. + - text: "nonpointerstructs: field PodGroup.Policy is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/scheduling/v1alpha1/types.go" - linters: - forbidigo @@ -414,6 +422,7 @@ linters: # - "nobools" # Bools do not evolve over time, should use enums instead. # - "nofloats" # Ensure floats are not used. - "nomaps" # Ensure maps are not used, unless they are `map[string]string` (for labels/annotations/etc). + - "nonpointerstructs" # Ensure non-pointer structs are correctly tagged as optional or required. - "nonullable" # Ensure fields are not marked as nullable. # - "nophase" # Ensure field names do not have the word "phase" in them. - "notimestamp" # Ensure fields are not named "timestamp", prefer "time". @@ -453,7 +462,6 @@ linters: # nomaps: # policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed. # optionalFields: - # policy: AllowOptionalFields # Determines how the linter should handle optional fields.optionalfields: # pointers: # preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`. # policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`. @@ -464,7 +472,6 @@ linters: # optionalOrRequired: # preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`. # preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`. - # policy: AllowOptionalFields # Determines how the linter should handle optional fields. # requiredFields: # pointers: # policy: SuggestFix | Warn # The policy for pointers in required fields. Defaults to `SuggestFix`. diff --git a/hack/kube-api-linter/exceptions.yaml b/hack/kube-api-linter/exceptions.yaml index b31d8091376..9d14b2361da 100644 --- a/hack/kube-api-linter/exceptions.yaml +++ b/hack/kube-api-linter/exceptions.yaml @@ -89,8 +89,9 @@ path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go" # OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags. -- text: "must be marked as optional or required" - path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage|storagemigration)" +# The nonpointerstructs linter is included here as well as these two should be enabled hand-in-hand on each API group. +- text: "must be marked as optional or required|is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/(admission|apidiscovery|apps|authentication|authorization|autoscaling|batch|certificates|core|discovery|events|extensions|flowcontrol|networking|rbac|resource|storage)" # OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed. - text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required" @@ -99,3 +100,10 @@ # jsontags: 'Port' must be capitalized for backward compatibility - text: 'jsontags: field DaemonEndpoint.Port json tag does not match' path: "staging/src/k8s.io/api/core/v1/types.go" + +# NonPointerStructs - Existing fields that are non-pointer structs but where the current rules are incorrect. + +# The PodGroup.Policy field is a union type, but is not marked up as a union, nor does nonpointerstructs understand unions today. +# Validation makes this require at least one of the fields within to be set. +- text: "nonpointerstructs: field PodGroup.Policy is a non-pointer struct with no required fields." + path: "staging/src/k8s.io/api/scheduling/v1alpha1/types.go" diff --git a/hack/kube-api-linter/kube-api-linter.yaml b/hack/kube-api-linter/kube-api-linter.yaml index 84dd20d8999..2ce454912be 100644 --- a/hack/kube-api-linter/kube-api-linter.yaml +++ b/hack/kube-api-linter/kube-api-linter.yaml @@ -12,6 +12,7 @@ linters: # - "nobools" # Bools do not evolve over time, should use enums instead. # - "nofloats" # Ensure floats are not used. - "nomaps" # Ensure maps are not used, unless they are `map[string]string` (for labels/annotations/etc). + - "nonpointerstructs" # Ensure non-pointer structs are correctly tagged as optional or required. - "nonullable" # Ensure fields are not marked as nullable. # - "nophase" # Ensure field names do not have the word "phase" in them. - "notimestamp" # Ensure fields are not named "timestamp", prefer "time". @@ -51,7 +52,6 @@ lintersConfig: # nomaps: # policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed. # optionalFields: - # policy: AllowOptionalFields # Determines how the linter should handle optional fields.optionalfields: # pointers: # preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`. # policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`. @@ -62,7 +62,6 @@ lintersConfig: # optionalOrRequired: # preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`. # preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`. - # policy: AllowOptionalFields # Determines how the linter should handle optional fields. # requiredFields: # pointers: # policy: SuggestFix | Warn # The policy for pointers in required fields. Defaults to `SuggestFix`. diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 6fce2b14b4f..7efbcbd67e1 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -2448,6 +2448,7 @@ func schema_k8sio_api_admissionregistration_v1_ValidatingAdmissionPolicyBinding( }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -4043,6 +4044,7 @@ func schema_k8sio_api_admissionregistration_v1alpha1_ValidatingAdmissionPolicyBi }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -5645,6 +5647,7 @@ func schema_k8sio_api_admissionregistration_v1beta1_ValidatingAdmissionPolicyBin }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -7133,6 +7136,7 @@ func schema_k8sio_api_apiserverinternal_v1alpha1_ServerStorageVersion(ref common }, }, }, + Required: []string{"apiServerID", "encodingVersion", "decodableVersions"}, }, }, } @@ -7181,7 +7185,7 @@ func schema_k8sio_api_apiserverinternal_v1alpha1_StorageVersion(ref common.Refer }, }, }, - Required: []string{"spec", "status"}, + Required: []string{"metadata"}, }, }, Dependencies: []string{ @@ -14380,6 +14384,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref common.Referenc }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -15351,6 +15356,7 @@ func schema_k8sio_api_autoscaling_v2_HorizontalPodAutoscaler(ref common.Referenc }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -16092,6 +16098,7 @@ func schema_k8sio_api_batch_v1_CronJob(ref common.ReferenceCallback) common.Open }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -17011,6 +17018,7 @@ func schema_k8sio_api_batch_v1beta1_CronJob(ref common.ReferenceCallback) common }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -18564,6 +18572,7 @@ func schema_k8sio_api_coordination_v1alpha2_LeaseCandidate(ref common.ReferenceC }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -18759,6 +18768,7 @@ func schema_k8sio_api_coordination_v1beta1_LeaseCandidate(ref common.ReferenceCa }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -40734,6 +40744,7 @@ func schema_k8sio_api_networking_v1_IPAddress(ref common.ReferenceCallback) comm }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ @@ -42188,6 +42199,7 @@ func schema_k8sio_api_networking_v1beta1_IPAddress(ref common.ReferenceCallback) }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ diff --git a/staging/src/k8s.io/api/admissionregistration/v1/generated.proto b/staging/src/k8s.io/api/admissionregistration/v1/generated.proto index 8790255ba52..42db29497a4 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1/generated.proto +++ b/staging/src/k8s.io/api/admissionregistration/v1/generated.proto @@ -604,6 +604,7 @@ message ValidatingAdmissionPolicyBinding { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required optional ValidatingAdmissionPolicyBindingSpec spec = 2; } diff --git a/staging/src/k8s.io/api/admissionregistration/v1/types.go b/staging/src/k8s.io/api/admissionregistration/v1/types.go index 6d85a310d50..636eb406f0a 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1/types.go +++ b/staging/src/k8s.io/api/admissionregistration/v1/types.go @@ -452,6 +452,7 @@ type ValidatingAdmissionPolicyBinding struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required Spec ValidatingAdmissionPolicyBindingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/admissionregistration/v1alpha1/generated.proto b/staging/src/k8s.io/api/admissionregistration/v1alpha1/generated.proto index 0692e50cd6b..04499d45860 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/admissionregistration/v1alpha1/generated.proto @@ -627,6 +627,7 @@ message ValidatingAdmissionPolicyBinding { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required optional ValidatingAdmissionPolicyBindingSpec spec = 2; } diff --git a/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go b/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go index 72e8916f4a3..339df8c8f7a 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go +++ b/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go @@ -392,6 +392,7 @@ type ValidatingAdmissionPolicyBinding struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required Spec ValidatingAdmissionPolicyBindingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/admissionregistration/v1beta1/generated.proto b/staging/src/k8s.io/api/admissionregistration/v1beta1/generated.proto index 4a1ba6af4f4..a395c0a2ee4 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/admissionregistration/v1beta1/generated.proto @@ -853,6 +853,7 @@ message ValidatingAdmissionPolicyBinding { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required optional ValidatingAdmissionPolicyBindingSpec spec = 2; } diff --git a/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go b/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go index 32315ed7ff4..5599078b8d4 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go +++ b/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go @@ -405,6 +405,7 @@ type ValidatingAdmissionPolicyBinding struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. + // +required Spec ValidatingAdmissionPolicyBindingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/apiserverinternal/v1alpha1/generated.proto b/staging/src/k8s.io/api/apiserverinternal/v1alpha1/generated.proto index 8a77860720f..b6fb42b9a5a 100644 --- a/staging/src/k8s.io/api/apiserverinternal/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/apiserverinternal/v1alpha1/generated.proto @@ -32,33 +32,40 @@ option go_package = "k8s.io/api/apiserverinternal/v1alpha1"; // encodes objects to when persisting objects in the backend. message ServerStorageVersion { // The ID of the reporting API server. + // +required optional string apiServerID = 1; // The API server encodes the object to this version when persisting it in // the backend (e.g., etcd). + // +required optional string encodingVersion = 2; // The API server can decode objects encoded in these versions. // The encodingVersion must be included in the decodableVersions. // +listType=set + // +required repeated string decodableVersions = 3; // The API server can serve these versions. // DecodableVersions must include all ServedVersions. // +listType=set + // +optional repeated string servedVersions = 4; } // Storage version of a specific resource. message StorageVersion { // The name is .. + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec is an empty spec. It is here to comply with Kubernetes API style. + // +optional optional StorageVersionSpec spec = 2; // API server instances report the version they can decode and the version they // encode objects to when persisting objects in the backend. + // +optional optional StorageVersionStatus status = 3; } @@ -77,6 +84,7 @@ message StorageVersionCondition { optional int64 observedGeneration = 3; // Last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; // The reason for the condition's last transition. diff --git a/staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go b/staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go index 31a419abf13..bbf30cfbf4f 100644 --- a/staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go +++ b/staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go @@ -28,13 +28,16 @@ import ( type StorageVersion struct { metav1.TypeMeta `json:",inline"` // The name is .. + // +required metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec is an empty spec. It is here to comply with Kubernetes API style. + // +optional Spec StorageVersionSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // API server instances report the version they can decode and the version they // encode objects to when persisting objects in the backend. + // +optional Status StorageVersionStatus `json:"status" protobuf:"bytes,3,opt,name=status"` } @@ -67,20 +70,24 @@ type StorageVersionStatus struct { // encodes objects to when persisting objects in the backend. type ServerStorageVersion struct { // The ID of the reporting API server. + // +required APIServerID string `json:"apiServerID,omitempty" protobuf:"bytes,1,opt,name=apiServerID"` // The API server encodes the object to this version when persisting it in // the backend (e.g., etcd). + // +required EncodingVersion string `json:"encodingVersion,omitempty" protobuf:"bytes,2,opt,name=encodingVersion"` // The API server can decode objects encoded in these versions. // The encodingVersion must be included in the decodableVersions. // +listType=set + // +required DecodableVersions []string `json:"decodableVersions,omitempty" protobuf:"bytes,3,opt,name=decodableVersions"` // The API server can serve these versions. // DecodableVersions must include all ServedVersions. // +listType=set + // +optional ServedVersions []string `json:"servedVersions,omitempty" protobuf:"bytes,4,opt,name=servedVersions"` } @@ -111,6 +118,7 @@ type StorageVersionCondition struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` // Last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` // The reason for the condition's last transition. // +required diff --git a/staging/src/k8s.io/api/autoscaling/v1/generated.proto b/staging/src/k8s.io/api/autoscaling/v1/generated.proto index 893acf80548..405c57fcbf9 100644 --- a/staging/src/k8s.io/api/autoscaling/v1/generated.proto +++ b/staging/src/k8s.io/api/autoscaling/v1/generated.proto @@ -148,7 +148,7 @@ message HorizontalPodAutoscaler { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional + // +required optional HorizontalPodAutoscalerSpec spec = 2; // status is the current information about the autoscaler. diff --git a/staging/src/k8s.io/api/autoscaling/v1/types.go b/staging/src/k8s.io/api/autoscaling/v1/types.go index 55079e980df..645ed2ac57d 100644 --- a/staging/src/k8s.io/api/autoscaling/v1/types.go +++ b/staging/src/k8s.io/api/autoscaling/v1/types.go @@ -97,7 +97,7 @@ type HorizontalPodAutoscaler struct { metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional + // +required Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // status is the current information about the autoscaler. diff --git a/staging/src/k8s.io/api/autoscaling/v2/generated.proto b/staging/src/k8s.io/api/autoscaling/v2/generated.proto index 39877eba6a8..75fc6cefb6f 100644 --- a/staging/src/k8s.io/api/autoscaling/v2/generated.proto +++ b/staging/src/k8s.io/api/autoscaling/v2/generated.proto @@ -175,7 +175,7 @@ message HorizontalPodAutoscaler { // spec is the specification for the behaviour of the autoscaler. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional + // +required optional HorizontalPodAutoscalerSpec spec = 2; // status is the current information about the autoscaler. diff --git a/staging/src/k8s.io/api/autoscaling/v2/types.go b/staging/src/k8s.io/api/autoscaling/v2/types.go index 1544e9a6089..84d1ec203ee 100644 --- a/staging/src/k8s.io/api/autoscaling/v2/types.go +++ b/staging/src/k8s.io/api/autoscaling/v2/types.go @@ -40,7 +40,7 @@ type HorizontalPodAutoscaler struct { // spec is the specification for the behaviour of the autoscaler. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional + // +required Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // status is the current information about the autoscaler. diff --git a/staging/src/k8s.io/api/batch/v1/generated.proto b/staging/src/k8s.io/api/batch/v1/generated.proto index 989fddc9d2f..3d7d36507b1 100644 --- a/staging/src/k8s.io/api/batch/v1/generated.proto +++ b/staging/src/k8s.io/api/batch/v1/generated.proto @@ -38,7 +38,7 @@ message CronJob { // Specification of the desired behavior of a cron job, including the schedule. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional CronJobSpec spec = 2; // Current status of a cron job. diff --git a/staging/src/k8s.io/api/batch/v1/types.go b/staging/src/k8s.io/api/batch/v1/types.go index 4927dfffbb2..cf6d7d3aacd 100644 --- a/staging/src/k8s.io/api/batch/v1/types.go +++ b/staging/src/k8s.io/api/batch/v1/types.go @@ -686,7 +686,7 @@ type CronJob struct { // Specification of the desired behavior of a cron job, including the schedule. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec CronJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Current status of a cron job. diff --git a/staging/src/k8s.io/api/batch/v1beta1/generated.proto b/staging/src/k8s.io/api/batch/v1beta1/generated.proto index 00a74b24ada..6a26bc728fe 100644 --- a/staging/src/k8s.io/api/batch/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/batch/v1beta1/generated.proto @@ -39,7 +39,7 @@ message CronJob { // Specification of the desired behavior of a cron job, including the schedule. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional CronJobSpec spec = 2; // Current status of a cron job. diff --git a/staging/src/k8s.io/api/batch/v1beta1/types.go b/staging/src/k8s.io/api/batch/v1beta1/types.go index b640388efc3..63de54bdfc4 100644 --- a/staging/src/k8s.io/api/batch/v1beta1/types.go +++ b/staging/src/k8s.io/api/batch/v1beta1/types.go @@ -52,7 +52,7 @@ type CronJob struct { // Specification of the desired behavior of a cron job, including the schedule. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec CronJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Current status of a cron job. diff --git a/staging/src/k8s.io/api/certificates/v1beta1/generated.proto b/staging/src/k8s.io/api/certificates/v1beta1/generated.proto index 0d5c82a0b79..4554ec50488 100644 --- a/staging/src/k8s.io/api/certificates/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/certificates/v1beta1/generated.proto @@ -289,6 +289,7 @@ message PodCertificateRequest { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec contains the details about the certificate being requested. + // +required optional PodCertificateRequestSpec spec = 2; // status contains the issued certificate, and a standard set of conditions. diff --git a/staging/src/k8s.io/api/certificates/v1beta1/types.go b/staging/src/k8s.io/api/certificates/v1beta1/types.go index 1eb566b5735..88d58fd4dc7 100644 --- a/staging/src/k8s.io/api/certificates/v1beta1/types.go +++ b/staging/src/k8s.io/api/certificates/v1beta1/types.go @@ -374,6 +374,7 @@ type PodCertificateRequest struct { metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec contains the details about the certificate being requested. + // +required Spec PodCertificateRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // status contains the issued certificate, and a standard set of conditions. diff --git a/staging/src/k8s.io/api/coordination/v1alpha2/generated.proto b/staging/src/k8s.io/api/coordination/v1alpha2/generated.proto index 250c6113ec1..379fcf0d5d0 100644 --- a/staging/src/k8s.io/api/coordination/v1alpha2/generated.proto +++ b/staging/src/k8s.io/api/coordination/v1alpha2/generated.proto @@ -38,7 +38,7 @@ message LeaseCandidate { // spec contains the specification of the Lease. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional LeaseCandidateSpec spec = 2; } diff --git a/staging/src/k8s.io/api/coordination/v1alpha2/types.go b/staging/src/k8s.io/api/coordination/v1alpha2/types.go index 13e1deb067d..f8a6d33af11 100644 --- a/staging/src/k8s.io/api/coordination/v1alpha2/types.go +++ b/staging/src/k8s.io/api/coordination/v1alpha2/types.go @@ -35,7 +35,7 @@ type LeaseCandidate struct { // spec contains the specification of the Lease. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/coordination/v1beta1/generated.proto b/staging/src/k8s.io/api/coordination/v1beta1/generated.proto index 7ca043f5288..74df40c64fe 100644 --- a/staging/src/k8s.io/api/coordination/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/coordination/v1beta1/generated.proto @@ -50,7 +50,7 @@ message LeaseCandidate { // spec contains the specification of the Lease. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional LeaseCandidateSpec spec = 2; } diff --git a/staging/src/k8s.io/api/coordination/v1beta1/types.go b/staging/src/k8s.io/api/coordination/v1beta1/types.go index 781d29efce1..ba6d6aa095a 100644 --- a/staging/src/k8s.io/api/coordination/v1beta1/types.go +++ b/staging/src/k8s.io/api/coordination/v1beta1/types.go @@ -106,7 +106,7 @@ type LeaseCandidate struct { // spec contains the specification of the Lease. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/networking/v1/generated.proto b/staging/src/k8s.io/api/networking/v1/generated.proto index 2231eda22ad..c4f4d24aaed 100644 --- a/staging/src/k8s.io/api/networking/v1/generated.proto +++ b/staging/src/k8s.io/api/networking/v1/generated.proto @@ -87,7 +87,7 @@ message IPAddress { // spec is the desired state of the IPAddress. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional IPAddressSpec spec = 2; } diff --git a/staging/src/k8s.io/api/networking/v1/types.go b/staging/src/k8s.io/api/networking/v1/types.go index 0188ee0fd5b..f6e65eb3bdb 100644 --- a/staging/src/k8s.io/api/networking/v1/types.go +++ b/staging/src/k8s.io/api/networking/v1/types.go @@ -662,7 +662,7 @@ type IPAddress struct { metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec is the desired state of the IPAddress. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec IPAddressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/networking/v1beta1/generated.proto b/staging/src/k8s.io/api/networking/v1beta1/generated.proto index 7cef8b90cb7..616f6e9bd1a 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/networking/v1beta1/generated.proto @@ -88,7 +88,7 @@ message IPAddress { // spec is the desired state of the IPAddress. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional IPAddressSpec spec = 2; } diff --git a/staging/src/k8s.io/api/networking/v1beta1/types.go b/staging/src/k8s.io/api/networking/v1beta1/types.go index a49c678802c..d84e6a1275c 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/types.go +++ b/staging/src/k8s.io/api/networking/v1beta1/types.go @@ -447,7 +447,7 @@ type IPAddress struct { metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec is the desired state of the IPAddress. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec IPAddressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } diff --git a/staging/src/k8s.io/api/rbac/v1/generated.proto b/staging/src/k8s.io/api/rbac/v1/generated.proto index 56869814ec4..7e3a9d2af79 100644 --- a/staging/src/k8s.io/api/rbac/v1/generated.proto +++ b/staging/src/k8s.io/api/rbac/v1/generated.proto @@ -70,6 +70,7 @@ message ClusterRoleBinding { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required optional RoleRef roleRef = 3; } @@ -152,6 +153,7 @@ message RoleBinding { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required optional RoleRef roleRef = 3; } diff --git a/staging/src/k8s.io/api/rbac/v1/types.go b/staging/src/k8s.io/api/rbac/v1/types.go index 2fde11b3064..7ebe10d749f 100644 --- a/staging/src/k8s.io/api/rbac/v1/types.go +++ b/staging/src/k8s.io/api/rbac/v1/types.go @@ -146,6 +146,7 @@ type RoleBinding struct { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -231,6 +232,7 @@ type ClusterRoleBinding struct { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } diff --git a/staging/src/k8s.io/api/rbac/v1alpha1/generated.proto b/staging/src/k8s.io/api/rbac/v1alpha1/generated.proto index f787f3976e7..b9e63df836f 100644 --- a/staging/src/k8s.io/api/rbac/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/rbac/v1alpha1/generated.proto @@ -71,6 +71,7 @@ message ClusterRoleBinding { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required optional RoleRef roleRef = 3; } @@ -156,6 +157,7 @@ message RoleBinding { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required optional RoleRef roleRef = 3; } diff --git a/staging/src/k8s.io/api/rbac/v1alpha1/types.go b/staging/src/k8s.io/api/rbac/v1alpha1/types.go index a0d52ee4fc7..5ad7d33fb6b 100644 --- a/staging/src/k8s.io/api/rbac/v1alpha1/types.go +++ b/staging/src/k8s.io/api/rbac/v1alpha1/types.go @@ -144,6 +144,7 @@ type RoleBinding struct { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -228,6 +229,7 @@ type ClusterRoleBinding struct { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } diff --git a/staging/src/k8s.io/api/rbac/v1beta1/generated.proto b/staging/src/k8s.io/api/rbac/v1beta1/generated.proto index cac7b413e87..6e225ac8cdd 100644 --- a/staging/src/k8s.io/api/rbac/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/rbac/v1beta1/generated.proto @@ -71,6 +71,7 @@ message ClusterRoleBinding { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required optional RoleRef roleRef = 3; } @@ -157,6 +158,7 @@ message RoleBinding { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required optional RoleRef roleRef = 3; } diff --git a/staging/src/k8s.io/api/rbac/v1beta1/types.go b/staging/src/k8s.io/api/rbac/v1beta1/types.go index 861e33c9755..183222e9d37 100644 --- a/staging/src/k8s.io/api/rbac/v1beta1/types.go +++ b/staging/src/k8s.io/api/rbac/v1beta1/types.go @@ -152,6 +152,7 @@ type RoleBinding struct { // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -251,6 +252,7 @@ type ClusterRoleBinding struct { // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } diff --git a/staging/src/k8s.io/api/resource/v1/generated.proto b/staging/src/k8s.io/api/resource/v1/generated.proto index eb008939c7f..1e87627497c 100644 --- a/staging/src/k8s.io/api/resource/v1/generated.proto +++ b/staging/src/k8s.io/api/resource/v1/generated.proto @@ -1586,6 +1586,7 @@ message ResourceSlice { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required optional ResourceSliceSpec spec = 2; } diff --git a/staging/src/k8s.io/api/resource/v1/types.go b/staging/src/k8s.io/api/resource/v1/types.go index 5f8b31ef732..1ea035d0033 100644 --- a/staging/src/k8s.io/api/resource/v1/types.go +++ b/staging/src/k8s.io/api/resource/v1/types.go @@ -79,6 +79,7 @@ type ResourceSlice struct { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"` } diff --git a/staging/src/k8s.io/api/resource/v1alpha3/generated.proto b/staging/src/k8s.io/api/resource/v1alpha3/generated.proto index 6414216db29..f7fae0be64d 100644 --- a/staging/src/k8s.io/api/resource/v1alpha3/generated.proto +++ b/staging/src/k8s.io/api/resource/v1alpha3/generated.proto @@ -140,6 +140,7 @@ message DeviceTaintRule { // Spec specifies the selector and one taint. // // Changing the spec automatically increments the metadata.generation number. + // +required optional DeviceTaintRuleSpec spec = 2; // Status provides information about what was requested in the spec. diff --git a/staging/src/k8s.io/api/resource/v1alpha3/types.go b/staging/src/k8s.io/api/resource/v1alpha3/types.go index ba02edabaa6..9c58bc611e7 100644 --- a/staging/src/k8s.io/api/resource/v1alpha3/types.go +++ b/staging/src/k8s.io/api/resource/v1alpha3/types.go @@ -201,6 +201,7 @@ type DeviceTaintRule struct { // Spec specifies the selector and one taint. // // Changing the spec automatically increments the metadata.generation number. + // +required Spec DeviceTaintRuleSpec `json:"spec" protobuf:"bytes,2,name=spec"` // Status provides information about what was requested in the spec. diff --git a/staging/src/k8s.io/api/resource/v1beta1/generated.proto b/staging/src/k8s.io/api/resource/v1beta1/generated.proto index 70bcf7987c7..5a3ed4ada98 100644 --- a/staging/src/k8s.io/api/resource/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/resource/v1beta1/generated.proto @@ -1613,6 +1613,7 @@ message ResourceSlice { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required optional ResourceSliceSpec spec = 2; } diff --git a/staging/src/k8s.io/api/resource/v1beta1/types.go b/staging/src/k8s.io/api/resource/v1beta1/types.go index 37d9923eaaf..a070049d4c8 100644 --- a/staging/src/k8s.io/api/resource/v1beta1/types.go +++ b/staging/src/k8s.io/api/resource/v1beta1/types.go @@ -82,6 +82,7 @@ type ResourceSlice struct { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"` } diff --git a/staging/src/k8s.io/api/resource/v1beta2/generated.proto b/staging/src/k8s.io/api/resource/v1beta2/generated.proto index c5fd95b7d8e..44816e484a6 100644 --- a/staging/src/k8s.io/api/resource/v1beta2/generated.proto +++ b/staging/src/k8s.io/api/resource/v1beta2/generated.proto @@ -1598,6 +1598,7 @@ message ResourceSlice { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required optional ResourceSliceSpec spec = 2; } diff --git a/staging/src/k8s.io/api/resource/v1beta2/types.go b/staging/src/k8s.io/api/resource/v1beta2/types.go index 8bb62f71a29..a33adb1e418 100644 --- a/staging/src/k8s.io/api/resource/v1beta2/types.go +++ b/staging/src/k8s.io/api/resource/v1beta2/types.go @@ -82,6 +82,7 @@ type ResourceSlice struct { // Contains the information published by the driver. // // Changing the spec automatically increments the metadata.generation number. + // +required Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"` } diff --git a/staging/src/k8s.io/api/storage/v1/generated.proto b/staging/src/k8s.io/api/storage/v1/generated.proto index dbc0a0012e6..09ccb8bd69c 100644 --- a/staging/src/k8s.io/api/storage/v1/generated.proto +++ b/staging/src/k8s.io/api/storage/v1/generated.proto @@ -510,6 +510,7 @@ message VolumeAttachment { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required optional VolumeAttachmentSpec spec = 2; // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/api/storage/v1/types.go b/staging/src/k8s.io/api/storage/v1/types.go index 6264eb7a4bd..b69e0cc94e3 100644 --- a/staging/src/k8s.io/api/storage/v1/types.go +++ b/staging/src/k8s.io/api/storage/v1/types.go @@ -134,6 +134,7 @@ type VolumeAttachment struct { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/api/storage/v1alpha1/generated.proto b/staging/src/k8s.io/api/storage/v1alpha1/generated.proto index b6cd87ede94..e975778fe1d 100644 --- a/staging/src/k8s.io/api/storage/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/storage/v1alpha1/generated.proto @@ -135,6 +135,7 @@ message VolumeAttachment { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required optional VolumeAttachmentSpec spec = 2; // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/api/storage/v1alpha1/types.go b/staging/src/k8s.io/api/storage/v1alpha1/types.go index 3374fdca665..96fb8022a99 100644 --- a/staging/src/k8s.io/api/storage/v1alpha1/types.go +++ b/staging/src/k8s.io/api/storage/v1alpha1/types.go @@ -45,6 +45,7 @@ type VolumeAttachment struct { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/api/storage/v1beta1/generated.proto b/staging/src/k8s.io/api/storage/v1beta1/generated.proto index b6815142e55..1b670ea5936 100644 --- a/staging/src/k8s.io/api/storage/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/storage/v1beta1/generated.proto @@ -512,6 +512,7 @@ message VolumeAttachment { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required optional VolumeAttachmentSpec spec = 2; // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/api/storage/v1beta1/types.go b/staging/src/k8s.io/api/storage/v1beta1/types.go index bc9468b935e..d9f52fa68a4 100644 --- a/staging/src/k8s.io/api/storage/v1beta1/types.go +++ b/staging/src/k8s.io/api/storage/v1beta1/types.go @@ -139,6 +139,7 @@ type VolumeAttachment struct { // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. // +k8s:immutable + // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // status represents status of the VolumeAttachment request. diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/generated/openapi/zz_generated.openapi.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/generated/openapi/zz_generated.openapi.go index 065019b5ebe..c1b67ea486e 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/generated/openapi/zz_generated.openapi.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/generated/openapi/zz_generated.openapi.go @@ -425,6 +425,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref common.Referenc }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{