apiserver: update copy, rename v1beta3 to v1

This commit is contained in:
Abu Kashem 2023-10-09 12:37:29 -04:00
parent dc72308093
commit 5cb03064d9
No known key found for this signature in database
GPG Key ID: E5ECC1124B5F9C68
7 changed files with 51 additions and 51 deletions

View File

@ -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
}

View File

@ -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,
},
},
},

View File

@ -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"

View File

@ -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
)

View File

@ -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"

View File

@ -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 {

View File

@ -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 {