From 8e25a4e87cd3eb9c3145d606c39b741da6429167 Mon Sep 17 00:00:00 2001 From: vinayakray19 Date: Wed, 11 Mar 2026 09:36:41 +0530 Subject: [PATCH] Mark all apidiscovery API fields as optional --- pkg/generated/openapi/zz_generated.openapi.go | 8 -------- .../k8s.io/api/apidiscovery/v2/generated.proto | 15 ++++++++------- staging/src/k8s.io/api/apidiscovery/v2/types.go | 15 ++++++++------- .../api/apidiscovery/v2beta1/generated.proto | 15 ++++++++------- .../src/k8s.io/api/apidiscovery/v2beta1/types.go | 15 ++++++++------- 5 files changed, 32 insertions(+), 36 deletions(-) diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 35f1c2320c5..3a528e3ca10 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -6797,7 +6797,6 @@ func schema_k8sio_api_apidiscovery_v2_APIGroupDiscoveryList(ref common.Reference }, }, }, - Required: []string{"items"}, }, }, Dependencies: []string{ @@ -6921,7 +6920,6 @@ func schema_k8sio_api_apidiscovery_v2_APIResourceDiscovery(ref common.ReferenceC }, }, }, - Required: []string{"resource", "scope", "singularResource", "verbs"}, }, }, Dependencies: []string{ @@ -6993,7 +6991,6 @@ func schema_k8sio_api_apidiscovery_v2_APISubresourceDiscovery(ref common.Referen }, }, }, - Required: []string{"subresource", "verbs"}, }, }, Dependencies: []string{ @@ -7045,7 +7042,6 @@ func schema_k8sio_api_apidiscovery_v2_APIVersionDiscovery(ref common.ReferenceCa }, }, }, - Required: []string{"version"}, }, }, Dependencies: []string{ @@ -7152,7 +7148,6 @@ func schema_k8sio_api_apidiscovery_v2beta1_APIGroupDiscoveryList(ref common.Refe }, }, }, - Required: []string{"items"}, }, }, Dependencies: []string{ @@ -7276,7 +7271,6 @@ func schema_k8sio_api_apidiscovery_v2beta1_APIResourceDiscovery(ref common.Refer }, }, }, - Required: []string{"resource", "scope", "singularResource", "verbs"}, }, }, Dependencies: []string{ @@ -7348,7 +7342,6 @@ func schema_k8sio_api_apidiscovery_v2beta1_APISubresourceDiscovery(ref common.Re }, }, }, - Required: []string{"subresource", "verbs"}, }, }, Dependencies: []string{ @@ -7400,7 +7393,6 @@ func schema_k8sio_api_apidiscovery_v2beta1_APIVersionDiscovery(ref common.Refere }, }, }, - Required: []string{"version"}, }, }, Dependencies: []string{ diff --git a/staging/src/k8s.io/api/apidiscovery/v2/generated.proto b/staging/src/k8s.io/api/apidiscovery/v2/generated.proto index 752b59ce7ef..8e9188d2f4a 100644 --- a/staging/src/k8s.io/api/apidiscovery/v2/generated.proto +++ b/staging/src/k8s.io/api/apidiscovery/v2/generated.proto @@ -59,6 +59,7 @@ message APIGroupDiscoveryList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of groups for discovery. The groups are listed in priority order. + // +optional repeated APIGroupDiscovery items = 2; } @@ -68,7 +69,7 @@ message APIResourceDiscovery { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ - // +required + // +optional optional string resource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. @@ -78,21 +79,21 @@ message APIResourceDiscovery { optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; // scope indicates the scope of a resource, either Cluster or Namespaced - // +required + // +optional optional string scope = 3; // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - // +required + // +optional optional string singularResource = 4; // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set - // +required + // +optional repeated string verbs = 5; // shortNames is a list of suggested short names of the resource. @@ -117,7 +118,7 @@ message APIResourceDiscovery { message APISubresourceDiscovery { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. - // +required + // +optional optional string subresource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. @@ -143,14 +144,14 @@ message APISubresourceDiscovery { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set - // +required + // +optional repeated string verbs = 4; } // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. message APIVersionDiscovery { // version is the name of the version within a group version. - // +required + // +optional optional string version = 1; // resources is a list of APIResourceDiscovery objects for the corresponding group version. diff --git a/staging/src/k8s.io/api/apidiscovery/v2/types.go b/staging/src/k8s.io/api/apidiscovery/v2/types.go index 99aa16fad2e..a9962edc251 100644 --- a/staging/src/k8s.io/api/apidiscovery/v2/types.go +++ b/staging/src/k8s.io/api/apidiscovery/v2/types.go @@ -34,6 +34,7 @@ type APIGroupDiscoveryList struct { // +optional v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of groups for discovery. The groups are listed in priority order. + // +optional Items []APIGroupDiscovery `json:"items" protobuf:"bytes,2,rep,name=items"` } @@ -63,7 +64,7 @@ type APIGroupDiscovery struct { // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. type APIVersionDiscovery struct { // version is the name of the version within a group version. - // +required + // +optional Version string `json:"version" protobuf:"bytes,1,opt,name=version"` // resources is a list of APIResourceDiscovery objects for the corresponding group version. // +listType=map @@ -87,7 +88,7 @@ type APIResourceDiscovery struct { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ - // +required + // +optional Resource string `json:"resource" protobuf:"bytes,1,opt,name=resource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. @@ -95,19 +96,19 @@ type APIResourceDiscovery struct { // +optional ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` // scope indicates the scope of a resource, either Cluster or Namespaced - // +required + // +optional Scope ResourceScope `json:"scope" protobuf:"bytes,3,opt,name=scope"` // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - // +required + // +optional SingularResource string `json:"singularResource" protobuf:"bytes,4,opt,name=singularResource"` // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set - // +required + // +optional Verbs []string `json:"verbs" protobuf:"bytes,5,opt,name=verbs"` // shortNames is a list of suggested short names of the resource. // +listType=set @@ -145,7 +146,7 @@ const ( type APISubresourceDiscovery struct { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. - // +required + // +optional Subresource string `json:"subresource" protobuf:"bytes,1,opt,name=subresource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // Some subresources do not return normal resources, these will have null or empty return types. @@ -168,6 +169,6 @@ type APISubresourceDiscovery struct { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set - // +required + // +optional Verbs []string `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` } diff --git a/staging/src/k8s.io/api/apidiscovery/v2beta1/generated.proto b/staging/src/k8s.io/api/apidiscovery/v2beta1/generated.proto index 57e09e84c0a..7f0ea9a95a5 100644 --- a/staging/src/k8s.io/api/apidiscovery/v2beta1/generated.proto +++ b/staging/src/k8s.io/api/apidiscovery/v2beta1/generated.proto @@ -59,6 +59,7 @@ message APIGroupDiscoveryList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of groups for discovery. The groups are listed in priority order. + // +optional repeated APIGroupDiscovery items = 2; } @@ -68,7 +69,7 @@ message APIResourceDiscovery { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ - // +required + // +optional optional string resource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. @@ -78,21 +79,21 @@ message APIResourceDiscovery { optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; // scope indicates the scope of a resource, either Cluster or Namespaced - // +required + // +optional optional string scope = 3; // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - // +required + // +optional optional string singularResource = 4; // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set - // +required + // +optional repeated string verbs = 5; // shortNames is a list of suggested short names of the resource. @@ -117,7 +118,7 @@ message APIResourceDiscovery { message APISubresourceDiscovery { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. - // +required + // +optional optional string subresource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. @@ -143,14 +144,14 @@ message APISubresourceDiscovery { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set - // +required + // +optional repeated string verbs = 4; } // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. message APIVersionDiscovery { // version is the name of the version within a group version. - // +required + // +optional optional string version = 1; // resources is a list of APIResourceDiscovery objects for the corresponding group version. diff --git a/staging/src/k8s.io/api/apidiscovery/v2beta1/types.go b/staging/src/k8s.io/api/apidiscovery/v2beta1/types.go index baf18427a4f..d7f6aab6443 100644 --- a/staging/src/k8s.io/api/apidiscovery/v2beta1/types.go +++ b/staging/src/k8s.io/api/apidiscovery/v2beta1/types.go @@ -37,6 +37,7 @@ type APIGroupDiscoveryList struct { // +optional v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of groups for discovery. The groups are listed in priority order. + // +optional Items []APIGroupDiscovery `json:"items" protobuf:"bytes,2,rep,name=items"` } @@ -69,7 +70,7 @@ type APIGroupDiscovery struct { // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. type APIVersionDiscovery struct { // version is the name of the version within a group version. - // +required + // +optional Version string `json:"version" protobuf:"bytes,1,opt,name=version"` // resources is a list of APIResourceDiscovery objects for the corresponding group version. // +listType=map @@ -93,7 +94,7 @@ type APIResourceDiscovery struct { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ - // +required + // +optional Resource string `json:"resource" protobuf:"bytes,1,opt,name=resource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. @@ -101,19 +102,19 @@ type APIResourceDiscovery struct { // +optional ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` // scope indicates the scope of a resource, either Cluster or Namespaced - // +required + // +optional Scope ResourceScope `json:"scope" protobuf:"bytes,3,opt,name=scope"` // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - // +required + // +optional SingularResource string `json:"singularResource" protobuf:"bytes,4,opt,name=singularResource"` // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set - // +required + // +optional Verbs []string `json:"verbs" protobuf:"bytes,5,opt,name=verbs"` // shortNames is a list of suggested short names of the resource. // +listType=set @@ -151,7 +152,7 @@ const ( type APISubresourceDiscovery struct { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. - // +required + // +optional Subresource string `json:"subresource" protobuf:"bytes,1,opt,name=subresource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // Some subresources do not return normal resources, these will have null or empty return types. @@ -174,6 +175,6 @@ type APISubresourceDiscovery struct { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set - // +required + // +optional Verbs []string `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` }