mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
apiserver: update copy, rename v1beta3 to v1
This commit is contained in:
parent
dc72308093
commit
5cb03064d9
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1beta3
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/api/flowcontrol/v1beta3"
|
v1 "k8s.io/api/flowcontrol/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default settings for flow-schema
|
// Default settings for flow-schema
|
||||||
@ -34,13 +34,13 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// SetDefaults_FlowSchema sets default values for flow schema
|
// SetDefaults_FlowSchema sets default values for flow schema
|
||||||
func SetDefaults_FlowSchemaSpec(spec *v1beta3.FlowSchemaSpec) {
|
func SetDefaults_FlowSchemaSpec(spec *v1.FlowSchemaSpec) {
|
||||||
if spec.MatchingPrecedence == 0 {
|
if spec.MatchingPrecedence == 0 {
|
||||||
spec.MatchingPrecedence = FlowSchemaDefaultMatchingPrecedence
|
spec.MatchingPrecedence = FlowSchemaDefaultMatchingPrecedence
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetDefaults_ExemptPriorityLevelConfiguration(eplc *v1beta3.ExemptPriorityLevelConfiguration) {
|
func SetDefaults_ExemptPriorityLevelConfiguration(eplc *v1.ExemptPriorityLevelConfiguration) {
|
||||||
if eplc.NominalConcurrencyShares == nil {
|
if eplc.NominalConcurrencyShares == nil {
|
||||||
eplc.NominalConcurrencyShares = new(int32)
|
eplc.NominalConcurrencyShares = new(int32)
|
||||||
*eplc.NominalConcurrencyShares = 0
|
*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 {
|
if lplc.NominalConcurrencyShares == 0 {
|
||||||
lplc.NominalConcurrencyShares = PriorityLevelConfigurationDefaultNominalConcurrencyShares
|
lplc.NominalConcurrencyShares = PriorityLevelConfigurationDefaultNominalConcurrencyShares
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1beta3.LimitedPriority
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetDefaults_FlowSchema sets default values for flow schema
|
// SetDefaults_FlowSchema sets default values for flow schema
|
||||||
func SetDefaults_QueuingConfiguration(cfg *v1beta3.QueuingConfiguration) {
|
func SetDefaults_QueuingConfiguration(cfg *v1.QueuingConfiguration) {
|
||||||
if cfg.HandSize == 0 {
|
if cfg.HandSize == 0 {
|
||||||
cfg.HandSize = PriorityLevelConfigurationDefaultHandSize
|
cfg.HandSize = PriorityLevelConfigurationDefaultHandSize
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1beta3
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -22,7 +22,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"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/apimachinery/pkg/runtime"
|
||||||
"k8s.io/utils/pointer"
|
"k8s.io/utils/pointer"
|
||||||
)
|
)
|
||||||
@ -35,16 +35,16 @@ func TestDefaultWithPriorityLevelConfiguration(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Defaulting for Exempt",
|
name: "Defaulting for Exempt",
|
||||||
original: &flowcontrolv1beta3.PriorityLevelConfiguration{
|
original: &flowcontrolv1.PriorityLevelConfiguration{
|
||||||
Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{
|
Spec: flowcontrolv1.PriorityLevelConfigurationSpec{
|
||||||
Type: flowcontrolv1beta3.PriorityLevelEnablementExempt,
|
Type: flowcontrolv1.PriorityLevelEnablementExempt,
|
||||||
Exempt: &flowcontrolv1beta3.ExemptPriorityLevelConfiguration{},
|
Exempt: &flowcontrolv1.ExemptPriorityLevelConfiguration{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expected: &flowcontrolv1beta3.PriorityLevelConfiguration{
|
expected: &flowcontrolv1.PriorityLevelConfiguration{
|
||||||
Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{
|
Spec: flowcontrolv1.PriorityLevelConfigurationSpec{
|
||||||
Type: flowcontrolv1beta3.PriorityLevelEnablementExempt,
|
Type: flowcontrolv1.PriorityLevelEnablementExempt,
|
||||||
Exempt: &flowcontrolv1beta3.ExemptPriorityLevelConfiguration{
|
Exempt: &flowcontrolv1.ExemptPriorityLevelConfiguration{
|
||||||
NominalConcurrencyShares: pointer.Int32(0),
|
NominalConcurrencyShares: pointer.Int32(0),
|
||||||
LendablePercent: 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",
|
name: "LendablePercent is not specified in Limited, should default to zero",
|
||||||
original: &flowcontrolv1beta3.PriorityLevelConfiguration{
|
original: &flowcontrolv1.PriorityLevelConfiguration{
|
||||||
Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{
|
Spec: flowcontrolv1.PriorityLevelConfigurationSpec{
|
||||||
Type: flowcontrolv1beta3.PriorityLevelEnablementLimited,
|
Type: flowcontrolv1.PriorityLevelEnablementLimited,
|
||||||
Limited: &flowcontrolv1beta3.LimitedPriorityLevelConfiguration{
|
Limited: &flowcontrolv1.LimitedPriorityLevelConfiguration{
|
||||||
NominalConcurrencyShares: 5,
|
NominalConcurrencyShares: 5,
|
||||||
LimitResponse: flowcontrolv1beta3.LimitResponse{
|
LimitResponse: flowcontrolv1.LimitResponse{
|
||||||
Type: flowcontrolv1beta3.LimitResponseTypeReject,
|
Type: flowcontrolv1.LimitResponseTypeReject,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expected: &flowcontrolv1beta3.PriorityLevelConfiguration{
|
expected: &flowcontrolv1.PriorityLevelConfiguration{
|
||||||
Spec: flowcontrolv1beta3.PriorityLevelConfigurationSpec{
|
Spec: flowcontrolv1.PriorityLevelConfigurationSpec{
|
||||||
Type: flowcontrolv1beta3.PriorityLevelEnablementLimited,
|
Type: flowcontrolv1.PriorityLevelEnablementLimited,
|
||||||
Limited: &flowcontrolv1beta3.LimitedPriorityLevelConfiguration{
|
Limited: &flowcontrolv1.LimitedPriorityLevelConfiguration{
|
||||||
NominalConcurrencyShares: 5,
|
NominalConcurrencyShares: 5,
|
||||||
LendablePercent: pointer.Int32(0),
|
LendablePercent: pointer.Int32(0),
|
||||||
LimitResponse: flowcontrolv1beta3.LimitResponse{
|
LimitResponse: flowcontrolv1.LimitResponse{
|
||||||
Type: flowcontrolv1beta3.LimitResponseTypeReject,
|
Type: flowcontrolv1.LimitResponseTypeReject,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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=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=TypeMeta
|
||||||
// +k8s:defaulter-gen-input=k8s.io/api/flowcontrol/v1beta3
|
// +k8s:defaulter-gen-input=k8s.io/api/flowcontrol/v1
|
||||||
|
|
||||||
// +groupName=flowcontrol.apiserver.k8s.io
|
// +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"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1beta3
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3"
|
flowcontrolv1 "k8s.io/api/flowcontrol/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ import (
|
|||||||
const GroupName = "flowcontrol.apiserver.k8s.io"
|
const GroupName = "flowcontrol.apiserver.k8s.io"
|
||||||
|
|
||||||
// SchemeGroupVersion is group version used to register these objects
|
// 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
|
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||||
func Resource(resource string) schema.GroupResource {
|
func Resource(resource string) schema.GroupResource {
|
||||||
@ -33,7 +33,7 @@ func Resource(resource string) schema.GroupResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
localSchemeBuilder = &flowcontrolv1beta3.SchemeBuilder
|
localSchemeBuilder = &flowcontrolv1.SchemeBuilder
|
||||||
// AddToScheme adds api to a scheme
|
// AddToScheme adds api to a scheme
|
||||||
AddToScheme = localSchemeBuilder.AddToScheme
|
AddToScheme = localSchemeBuilder.AddToScheme
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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
|
// +groupName=flowcontrol.apiserver.k8s.io
|
||||||
|
|
||||||
// Package v1beta3 holds api types of version v1beta3 for group "flowcontrol.apiserver.k8s.io".
|
// Package v1 holds api types of version v1 for group "flowcontrol.apiserver.k8s.io".
|
||||||
package v1beta3 // import "k8s.io/api/flowcontrol/v1beta3"
|
package v1 // import "k8s.io/api/flowcontrol/v1"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1beta3
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -26,7 +26,7 @@ import (
|
|||||||
const GroupName = "flowcontrol.apiserver.k8s.io"
|
const GroupName = "flowcontrol.apiserver.k8s.io"
|
||||||
|
|
||||||
// SchemeGroupVersion is group version used to register these objects
|
// 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
|
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||||
func Kind(kind string) schema.GroupKind {
|
func Kind(kind string) schema.GroupKind {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Kubernetes Authors.
|
Copyright 2023 The Kubernetes Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1beta3
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -106,7 +106,7 @@ const (
|
|||||||
// +genclient
|
// +genclient
|
||||||
// +genclient:nonNamespaced
|
// +genclient:nonNamespaced
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +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
|
// 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".
|
// 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: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.
|
// FlowSchemaList is a list of FlowSchema objects.
|
||||||
type FlowSchemaList struct {
|
type FlowSchemaList struct {
|
||||||
@ -383,7 +383,7 @@ type FlowSchemaConditionType string
|
|||||||
// +genclient
|
// +genclient
|
||||||
// +genclient:nonNamespaced
|
// +genclient:nonNamespaced
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +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.
|
// PriorityLevelConfiguration represents the configuration of a priority level.
|
||||||
type PriorityLevelConfiguration struct {
|
type PriorityLevelConfiguration struct {
|
||||||
@ -403,7 +403,7 @@ type PriorityLevelConfiguration struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +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.
|
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
|
||||||
type PriorityLevelConfigurationList struct {
|
type PriorityLevelConfigurationList struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user