From 5cb03064d95d2ddb83f25cb5824982c0f4ca4e72 Mon Sep 17 00:00:00 2001 From: Abu Kashem Date: Mon, 9 Oct 2023 12:37:29 -0400 Subject: [PATCH] apiserver: update copy, rename v1beta3 to v1 --- pkg/apis/flowcontrol/v1/defaults.go | 14 +++--- pkg/apis/flowcontrol/v1/defaults_test.go | 46 +++++++++---------- pkg/apis/flowcontrol/v1/doc.go | 8 ++-- pkg/apis/flowcontrol/v1/register.go | 10 ++-- staging/src/k8s.io/api/flowcontrol/v1/doc.go | 6 +-- .../src/k8s.io/api/flowcontrol/v1/register.go | 6 +-- .../src/k8s.io/api/flowcontrol/v1/types.go | 12 ++--- 7 files changed, 51 insertions(+), 51 deletions(-) diff --git a/pkg/apis/flowcontrol/v1/defaults.go b/pkg/apis/flowcontrol/v1/defaults.go index 151664f4439..956c0a8dd78 100644 --- a/pkg/apis/flowcontrol/v1/defaults.go +++ b/pkg/apis/flowcontrol/v1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( - "k8s.io/api/flowcontrol/v1beta3" + v1 "k8s.io/api/flowcontrol/v1" ) // Default settings for flow-schema @@ -34,13 +34,13 @@ const ( ) // SetDefaults_FlowSchema sets default values for flow schema -func SetDefaults_FlowSchemaSpec(spec *v1beta3.FlowSchemaSpec) { +func SetDefaults_FlowSchemaSpec(spec *v1.FlowSchemaSpec) { if spec.MatchingPrecedence == 0 { spec.MatchingPrecedence = FlowSchemaDefaultMatchingPrecedence } } -func SetDefaults_ExemptPriorityLevelConfiguration(eplc *v1beta3.ExemptPriorityLevelConfiguration) { +func SetDefaults_ExemptPriorityLevelConfiguration(eplc *v1.ExemptPriorityLevelConfiguration) { if eplc.NominalConcurrencyShares == nil { eplc.NominalConcurrencyShares = new(int32) *eplc.NominalConcurrencyShares = 0 @@ -51,7 +51,7 @@ func SetDefaults_ExemptPriorityLevelConfiguration(eplc *v1beta3.ExemptPriorityLe } } -func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1beta3.LimitedPriorityLevelConfiguration) { +func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1.LimitedPriorityLevelConfiguration) { if lplc.NominalConcurrencyShares == 0 { lplc.NominalConcurrencyShares = PriorityLevelConfigurationDefaultNominalConcurrencyShares } @@ -62,7 +62,7 @@ func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1beta3.LimitedPriority } // SetDefaults_FlowSchema sets default values for flow schema -func SetDefaults_QueuingConfiguration(cfg *v1beta3.QueuingConfiguration) { +func SetDefaults_QueuingConfiguration(cfg *v1.QueuingConfiguration) { if cfg.HandSize == 0 { cfg.HandSize = PriorityLevelConfigurationDefaultHandSize } diff --git a/pkg/apis/flowcontrol/v1/defaults_test.go b/pkg/apis/flowcontrol/v1/defaults_test.go index fced3b74a8a..5e199c3cd34 100644 --- a/pkg/apis/flowcontrol/v1/defaults_test.go +++ b/pkg/apis/flowcontrol/v1/defaults_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( "reflect" @@ -22,7 +22,7 @@ import ( "github.com/google/go-cmp/cmp" - flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" ) @@ -35,16 +35,16 @@ func TestDefaultWithPriorityLevelConfiguration(t *testing.T) { }{ { name: "Defaulting for Exempt", - original: &flowcontrolv1beta3.PriorityLevelConfiguration{ - Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{ - Type: flowcontrolv1beta3.PriorityLevelEnablementExempt, - Exempt: &flowcontrolv1beta3.ExemptPriorityLevelConfiguration{}, + original: &flowcontrolv1.PriorityLevelConfiguration{ + Spec: flowcontrolv1.PriorityLevelConfigurationSpec{ + Type: flowcontrolv1.PriorityLevelEnablementExempt, + Exempt: &flowcontrolv1.ExemptPriorityLevelConfiguration{}, }, }, - expected: &flowcontrolv1beta3.PriorityLevelConfiguration{ - Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{ - Type: flowcontrolv1beta3.PriorityLevelEnablementExempt, - Exempt: &flowcontrolv1beta3.ExemptPriorityLevelConfiguration{ + expected: &flowcontrolv1.PriorityLevelConfiguration{ + Spec: flowcontrolv1.PriorityLevelConfigurationSpec{ + Type: flowcontrolv1.PriorityLevelEnablementExempt, + Exempt: &flowcontrolv1.ExemptPriorityLevelConfiguration{ NominalConcurrencyShares: pointer.Int32(0), LendablePercent: pointer.Int32(0), }, @@ -53,25 +53,25 @@ func TestDefaultWithPriorityLevelConfiguration(t *testing.T) { }, { name: "LendablePercent is not specified in Limited, should default to zero", - original: &flowcontrolv1beta3.PriorityLevelConfiguration{ - Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{ - Type: flowcontrolv1beta3.PriorityLevelEnablementLimited, - Limited: &flowcontrolv1beta3.LimitedPriorityLevelConfiguration{ + original: &flowcontrolv1.PriorityLevelConfiguration{ + Spec: flowcontrolv1.PriorityLevelConfigurationSpec{ + Type: flowcontrolv1.PriorityLevelEnablementLimited, + Limited: &flowcontrolv1.LimitedPriorityLevelConfiguration{ NominalConcurrencyShares: 5, - LimitResponse: flowcontrolv1beta3.LimitResponse{ - Type: flowcontrolv1beta3.LimitResponseTypeReject, + LimitResponse: flowcontrolv1.LimitResponse{ + Type: flowcontrolv1.LimitResponseTypeReject, }, }, }, }, - expected: &flowcontrolv1beta3.PriorityLevelConfiguration{ - Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{ - Type: flowcontrolv1beta3.PriorityLevelEnablementLimited, - Limited: &flowcontrolv1beta3.LimitedPriorityLevelConfiguration{ + expected: &flowcontrolv1.PriorityLevelConfiguration{ + Spec: flowcontrolv1.PriorityLevelConfigurationSpec{ + Type: flowcontrolv1.PriorityLevelEnablementLimited, + Limited: &flowcontrolv1.LimitedPriorityLevelConfiguration{ NominalConcurrencyShares: 5, LendablePercent: pointer.Int32(0), - LimitResponse: flowcontrolv1beta3.LimitResponse{ - Type: flowcontrolv1beta3.LimitResponseTypeReject, + LimitResponse: flowcontrolv1.LimitResponse{ + Type: flowcontrolv1.LimitResponseTypeReject, }, }, }, diff --git a/pkg/apis/flowcontrol/v1/doc.go b/pkg/apis/flowcontrol/v1/doc.go index 5ba8cbf3e97..b35cfdcb1cc 100644 --- a/pkg/apis/flowcontrol/v1/doc.go +++ b/pkg/apis/flowcontrol/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,10 +15,10 @@ limitations under the License. */ // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/flowcontrol -// +k8s:conversion-gen-external-types=k8s.io/api/flowcontrol/v1beta3 +// +k8s:conversion-gen-external-types=k8s.io/api/flowcontrol/v1 // +k8s:defaulter-gen=TypeMeta -// +k8s:defaulter-gen-input=k8s.io/api/flowcontrol/v1beta3 +// +k8s:defaulter-gen-input=k8s.io/api/flowcontrol/v1 // +groupName=flowcontrol.apiserver.k8s.io -package v1beta3 // import "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta3" +package v1 // import "k8s.io/kubernetes/pkg/apis/flowcontrol/v1" diff --git a/pkg/apis/flowcontrol/v1/register.go b/pkg/apis/flowcontrol/v1/register.go index 8a937643170..a0d003d1687 100644 --- a/pkg/apis/flowcontrol/v1/register.go +++ b/pkg/apis/flowcontrol/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( - flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -25,7 +25,7 @@ import ( const GroupName = "flowcontrol.apiserver.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta3"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { @@ -33,7 +33,7 @@ func Resource(resource string) schema.GroupResource { } var ( - localSchemeBuilder = &flowcontrolv1beta3.SchemeBuilder + localSchemeBuilder = &flowcontrolv1.SchemeBuilder // AddToScheme adds api to a scheme AddToScheme = localSchemeBuilder.AddToScheme ) diff --git a/staging/src/k8s.io/api/flowcontrol/v1/doc.go b/staging/src/k8s.io/api/flowcontrol/v1/doc.go index cd60cfef7fe..c9e7db15893 100644 --- a/staging/src/k8s.io/api/flowcontrol/v1/doc.go +++ b/staging/src/k8s.io/api/flowcontrol/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,5 +21,5 @@ limitations under the License. // +groupName=flowcontrol.apiserver.k8s.io -// Package v1beta3 holds api types of version v1beta3 for group "flowcontrol.apiserver.k8s.io". -package v1beta3 // import "k8s.io/api/flowcontrol/v1beta3" +// Package v1 holds api types of version v1 for group "flowcontrol.apiserver.k8s.io". +package v1 // import "k8s.io/api/flowcontrol/v1" diff --git a/staging/src/k8s.io/api/flowcontrol/v1/register.go b/staging/src/k8s.io/api/flowcontrol/v1/register.go index baf10b1829e..02725b514e0 100644 --- a/staging/src/k8s.io/api/flowcontrol/v1/register.go +++ b/staging/src/k8s.io/api/flowcontrol/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +26,7 @@ import ( const GroupName = "flowcontrol.apiserver.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta3"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/staging/src/k8s.io/api/flowcontrol/v1/types.go b/staging/src/k8s.io/api/flowcontrol/v1/types.go index 810941557b2..04bc8bee454 100644 --- a/staging/src/k8s.io/api/flowcontrol/v1/types.go +++ b/staging/src/k8s.io/api/flowcontrol/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -106,7 +106,7 @@ const ( // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 +// +k8s:prerelease-lifecycle-gen:introduced=1.29 // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". @@ -127,7 +127,7 @@ type FlowSchema struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 +// +k8s:prerelease-lifecycle-gen:introduced=1.29 // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { @@ -383,7 +383,7 @@ type FlowSchemaConditionType string // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 +// +k8s:prerelease-lifecycle-gen:introduced=1.29 // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfiguration struct { @@ -403,7 +403,7 @@ type PriorityLevelConfiguration struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 +// +k8s:prerelease-lifecycle-gen:introduced=1.29 // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct {