From b9b585ac9ed0d2f37f35597783e9518ee60309e9 Mon Sep 17 00:00:00 2001 From: Ignoramuss Date: Mon, 5 Jan 2026 16:19:05 -0800 Subject: [PATCH] api: fix scheduling API optional/required markers - Change PriorityClass.Value from +required to +optional since there is no validation requiring it and no defaulting (0 is valid) - Remove +required from *List.Items fields as List types should not need optional/required markers on their Items field --- staging/src/k8s.io/api/scheduling/v1/generated.proto | 3 +-- staging/src/k8s.io/api/scheduling/v1/types.go | 3 +-- staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto | 4 +--- staging/src/k8s.io/api/scheduling/v1alpha1/types.go | 4 +--- staging/src/k8s.io/api/scheduling/v1beta1/generated.proto | 3 +-- staging/src/k8s.io/api/scheduling/v1beta1/types.go | 3 +-- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/staging/src/k8s.io/api/scheduling/v1/generated.proto b/staging/src/k8s.io/api/scheduling/v1/generated.proto index 27c336bc974..6be7204de14 100644 --- a/staging/src/k8s.io/api/scheduling/v1/generated.proto +++ b/staging/src/k8s.io/api/scheduling/v1/generated.proto @@ -39,7 +39,7 @@ message PriorityClass { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional optional int32 value = 2; // globalDefault specifies whether this PriorityClass should be considered as @@ -70,7 +70,6 @@ message PriorityClassList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of PriorityClasses - // +required repeated PriorityClass items = 2; } diff --git a/staging/src/k8s.io/api/scheduling/v1/types.go b/staging/src/k8s.io/api/scheduling/v1/types.go index 977c9681ac1..655b5eb159f 100644 --- a/staging/src/k8s.io/api/scheduling/v1/types.go +++ b/staging/src/k8s.io/api/scheduling/v1/types.go @@ -37,7 +37,7 @@ type PriorityClass struct { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"` // globalDefault specifies whether this PriorityClass should be considered as @@ -72,6 +72,5 @@ type PriorityClassList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of PriorityClasses - // +required Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"` } diff --git a/staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto b/staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto index 5ecddd3fe13..8471e96aa07 100644 --- a/staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto @@ -86,7 +86,7 @@ message PriorityClass { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional optional int32 value = 2; // globalDefault specifies whether this PriorityClass should be considered as @@ -117,7 +117,6 @@ message PriorityClassList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of PriorityClasses - // +required repeated PriorityClass items = 2; } @@ -168,7 +167,6 @@ message WorkloadList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // Items is the list of Workloads. - // +required repeated Workload items = 2; } diff --git a/staging/src/k8s.io/api/scheduling/v1alpha1/types.go b/staging/src/k8s.io/api/scheduling/v1alpha1/types.go index 5eadfe1dd55..cfc0c5837d5 100644 --- a/staging/src/k8s.io/api/scheduling/v1alpha1/types.go +++ b/staging/src/k8s.io/api/scheduling/v1alpha1/types.go @@ -37,7 +37,7 @@ type PriorityClass struct { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"` // globalDefault specifies whether this PriorityClass should be considered as @@ -71,7 +71,6 @@ type PriorityClassList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of PriorityClasses - // +required Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"` } @@ -106,7 +105,6 @@ type WorkloadList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Items is the list of Workloads. - // +required Items []Workload `json:"items" protobuf:"bytes,2,rep,name=items"` } diff --git a/staging/src/k8s.io/api/scheduling/v1beta1/generated.proto b/staging/src/k8s.io/api/scheduling/v1beta1/generated.proto index 1f0cf86b20e..0e701be5495 100644 --- a/staging/src/k8s.io/api/scheduling/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/scheduling/v1beta1/generated.proto @@ -40,7 +40,7 @@ message PriorityClass { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional optional int32 value = 2; // globalDefault specifies whether this PriorityClass should be considered as @@ -71,7 +71,6 @@ message PriorityClassList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of PriorityClasses - // +required repeated PriorityClass items = 2; } diff --git a/staging/src/k8s.io/api/scheduling/v1beta1/types.go b/staging/src/k8s.io/api/scheduling/v1beta1/types.go index 2519d7cf56a..8a7a2058f0b 100644 --- a/staging/src/k8s.io/api/scheduling/v1beta1/types.go +++ b/staging/src/k8s.io/api/scheduling/v1beta1/types.go @@ -41,7 +41,7 @@ type PriorityClass struct { // value represents the integer value of this priority class. This is the actual priority that pods // receive when they have the name of this class in their pod spec. - // +required + // +optional Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"` // globalDefault specifies whether this PriorityClass should be considered as @@ -79,6 +79,5 @@ type PriorityClassList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of PriorityClasses - // +required Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"` }