mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #104399 from tkashem/apf-v1beta2
apf: introduce v1beta2
This commit is contained in:
commit
cdcf2a239e
2594
api/openapi-spec/swagger.json
generated
2594
api/openapi-spec/swagger.json
generated
File diff suppressed because it is too large
Load Diff
@ -273,6 +273,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
|
||||
{Group: "node.k8s.io", Version: "v1beta1"}: {group: 16300, version: 9},
|
||||
{Group: "discovery.k8s.io", Version: "v1"}: {group: 16200, version: 15},
|
||||
{Group: "discovery.k8s.io", Version: "v1beta1"}: {group: 16200, version: 12},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2"}: {group: 16100, version: 15},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {group: 16100, version: 12},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16100, version: 9},
|
||||
{Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16000, version: 9},
|
||||
|
@ -134,7 +134,7 @@ func validateAPIPriorityAndFairness(options *ServerRunOptions) []error {
|
||||
// If none of the following runtime config options are specified, APF is
|
||||
// assumed to be turned on.
|
||||
enabledAPIString := options.APIEnablement.RuntimeConfig.String()
|
||||
testConfigs := []string{"flowcontrol.apiserver.k8s.io/v1beta1", "api/beta", "api/all"} // in the order of precedence
|
||||
testConfigs := []string{"flowcontrol.apiserver.k8s.io/v1beta2", "flowcontrol.apiserver.k8s.io/v1beta1", "api/beta", "api/all"} // in the order of precedence
|
||||
for _, testConfig := range testConfigs {
|
||||
if strings.Contains(enabledAPIString, fmt.Sprintf("%s=false", testConfig)) {
|
||||
return []error{fmt.Errorf("--runtime-config=%s=false conflicts with --enable-priority-and-fairness=true and --feature-gates=APIPriorityAndFairness=true", testConfig)}
|
||||
|
@ -507,7 +507,7 @@ func BuildPriorityAndFairness(s *options.ServerRunOptions, extclient clientgocli
|
||||
}
|
||||
return utilflowcontrol.New(
|
||||
versionedInformer,
|
||||
extclient.FlowcontrolV1beta1(),
|
||||
extclient.FlowcontrolV1beta2(),
|
||||
s.GenericServerRunOptions.MaxRequestsInFlight+s.GenericServerRunOptions.MaxMutatingRequestsInFlight,
|
||||
s.GenericServerRunOptions.RequestTimeout/4,
|
||||
), nil
|
||||
|
@ -108,6 +108,7 @@ storage.k8s.io/v1 \
|
||||
storage.k8s.io/v1alpha1 \
|
||||
flowcontrol.apiserver.k8s.io/v1alpha1 \
|
||||
flowcontrol.apiserver.k8s.io/v1beta1 \
|
||||
flowcontrol.apiserver.k8s.io/v1beta2 \
|
||||
internal.apiserver.k8s.io/v1alpha1 \
|
||||
}"
|
||||
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/flowcontrol"
|
||||
flowcontrolv1alpha1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -36,5 +37,6 @@ func Install(scheme *runtime.Scheme) {
|
||||
utilruntime.Must(flowcontrol.AddToScheme(scheme))
|
||||
utilruntime.Must(flowcontrolv1alpha1.AddToScheme(scheme))
|
||||
utilruntime.Must(flowcontrolv1beta1.AddToScheme(scheme))
|
||||
utilruntime.Must(scheme.SetVersionPriority(flowcontrolv1beta1.SchemeGroupVersion, flowcontrolv1alpha1.SchemeGroupVersion))
|
||||
utilruntime.Must(flowcontrolv1beta2.AddToScheme(scheme))
|
||||
utilruntime.Must(scheme.SetVersionPriority(flowcontrolv1beta1.SchemeGroupVersion, flowcontrolv1beta2.SchemeGroupVersion, flowcontrolv1alpha1.SchemeGroupVersion))
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package internalbootstrap
|
||||
|
||||
import (
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap"
|
||||
"k8s.io/kubernetes/pkg/apis/flowcontrol"
|
||||
@ -46,7 +46,7 @@ func NewAPFScheme() *runtime.Scheme {
|
||||
return scheme
|
||||
}
|
||||
|
||||
func internalizeFSes(exts []*flowcontrolv1beta1.FlowSchema) map[string]*flowcontrol.FlowSchema {
|
||||
func internalizeFSes(exts []*flowcontrolv1beta2.FlowSchema) map[string]*flowcontrol.FlowSchema {
|
||||
ans := make(map[string]*flowcontrol.FlowSchema, len(exts))
|
||||
scheme := NewAPFScheme()
|
||||
for _, ext := range exts {
|
||||
@ -59,7 +59,7 @@ func internalizeFSes(exts []*flowcontrolv1beta1.FlowSchema) map[string]*flowcont
|
||||
return ans
|
||||
}
|
||||
|
||||
func internalizePLs(exts []*flowcontrolv1beta1.PriorityLevelConfiguration) map[string]*flowcontrol.PriorityLevelConfiguration {
|
||||
func internalizePLs(exts []*flowcontrolv1beta2.PriorityLevelConfiguration) map[string]*flowcontrol.PriorityLevelConfiguration {
|
||||
ans := make(map[string]*flowcontrol.PriorityLevelConfiguration, len(exts))
|
||||
scheme := NewAPFScheme()
|
||||
for _, ext := range exts {
|
||||
|
@ -19,7 +19,7 @@ package internalbootstrap
|
||||
import (
|
||||
"testing"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||
"k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap"
|
||||
)
|
||||
|
60
pkg/apis/flowcontrol/v1beta2/defaults.go
Normal file
60
pkg/apis/flowcontrol/v1beta2/defaults.go
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2019 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// Default settings for flow-schema
|
||||
const (
|
||||
FlowSchemaDefaultMatchingPrecedence int32 = 1000
|
||||
)
|
||||
|
||||
// Default settings for priority-level-configuration
|
||||
const (
|
||||
PriorityLevelConfigurationDefaultHandSize int32 = 8
|
||||
PriorityLevelConfigurationDefaultQueues int32 = 64
|
||||
PriorityLevelConfigurationDefaultQueueLengthLimit int32 = 50
|
||||
PriorityLevelConfigurationDefaultAssuredConcurrencyShares int32 = 30
|
||||
)
|
||||
|
||||
// SetDefaults_FlowSchema sets default values for flow schema
|
||||
func SetDefaults_FlowSchemaSpec(spec *v1beta2.FlowSchemaSpec) {
|
||||
if spec.MatchingPrecedence == 0 {
|
||||
spec.MatchingPrecedence = FlowSchemaDefaultMatchingPrecedence
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1beta2.LimitedPriorityLevelConfiguration) {
|
||||
if lplc.AssuredConcurrencyShares == 0 {
|
||||
lplc.AssuredConcurrencyShares = PriorityLevelConfigurationDefaultAssuredConcurrencyShares
|
||||
}
|
||||
}
|
||||
|
||||
// SetDefaults_FlowSchema sets default values for flow schema
|
||||
func SetDefaults_QueuingConfiguration(cfg *v1beta2.QueuingConfiguration) {
|
||||
if cfg.HandSize == 0 {
|
||||
cfg.HandSize = PriorityLevelConfigurationDefaultHandSize
|
||||
}
|
||||
if cfg.Queues == 0 {
|
||||
cfg.Queues = PriorityLevelConfigurationDefaultQueues
|
||||
}
|
||||
if cfg.QueueLengthLimit == 0 {
|
||||
cfg.QueueLengthLimit = PriorityLevelConfigurationDefaultQueueLengthLimit
|
||||
}
|
||||
}
|
24
pkg/apis/flowcontrol/v1beta2/doc.go
Normal file
24
pkg/apis/flowcontrol/v1beta2/doc.go
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2021 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/flowcontrol
|
||||
// +k8s:conversion-gen-external-types=k8s.io/api/flowcontrol/v1beta2
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:defaulter-gen-input=k8s.io/api/flowcontrol/v1beta2
|
||||
|
||||
// +groupName=flowcontrol.apiserver.k8s.io
|
||||
|
||||
package v1beta2 // import "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
46
pkg/apis/flowcontrol/v1beta2/register.go
Normal file
46
pkg/apis/flowcontrol/v1beta2/register.go
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2021 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "flowcontrol.apiserver.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
localSchemeBuilder = &flowcontrolv1beta2.SchemeBuilder
|
||||
// AddToScheme adds api to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(RegisterDefaults)
|
||||
}
|
791
pkg/apis/flowcontrol/v1beta2/zz_generated.conversion.go
generated
Normal file
791
pkg/apis/flowcontrol/v1beta2/zz_generated.conversion.go
generated
Normal file
@ -0,0 +1,791 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
flowcontrol "k8s.io/kubernetes/pkg/apis/flowcontrol"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowDistinguisherMethod)(nil), (*flowcontrol.FlowDistinguisherMethod)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowDistinguisherMethod_To_flowcontrol_FlowDistinguisherMethod(a.(*v1beta2.FlowDistinguisherMethod), b.(*flowcontrol.FlowDistinguisherMethod), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowDistinguisherMethod)(nil), (*v1beta2.FlowDistinguisherMethod)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowDistinguisherMethod_To_v1beta2_FlowDistinguisherMethod(a.(*flowcontrol.FlowDistinguisherMethod), b.(*v1beta2.FlowDistinguisherMethod), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowSchema)(nil), (*flowcontrol.FlowSchema)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowSchema_To_flowcontrol_FlowSchema(a.(*v1beta2.FlowSchema), b.(*flowcontrol.FlowSchema), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowSchema)(nil), (*v1beta2.FlowSchema)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowSchema_To_v1beta2_FlowSchema(a.(*flowcontrol.FlowSchema), b.(*v1beta2.FlowSchema), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowSchemaCondition)(nil), (*flowcontrol.FlowSchemaCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowSchemaCondition_To_flowcontrol_FlowSchemaCondition(a.(*v1beta2.FlowSchemaCondition), b.(*flowcontrol.FlowSchemaCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowSchemaCondition)(nil), (*v1beta2.FlowSchemaCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowSchemaCondition_To_v1beta2_FlowSchemaCondition(a.(*flowcontrol.FlowSchemaCondition), b.(*v1beta2.FlowSchemaCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowSchemaList)(nil), (*flowcontrol.FlowSchemaList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowSchemaList_To_flowcontrol_FlowSchemaList(a.(*v1beta2.FlowSchemaList), b.(*flowcontrol.FlowSchemaList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowSchemaList)(nil), (*v1beta2.FlowSchemaList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowSchemaList_To_v1beta2_FlowSchemaList(a.(*flowcontrol.FlowSchemaList), b.(*v1beta2.FlowSchemaList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowSchemaSpec)(nil), (*flowcontrol.FlowSchemaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec(a.(*v1beta2.FlowSchemaSpec), b.(*flowcontrol.FlowSchemaSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowSchemaSpec)(nil), (*v1beta2.FlowSchemaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec(a.(*flowcontrol.FlowSchemaSpec), b.(*v1beta2.FlowSchemaSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.FlowSchemaStatus)(nil), (*flowcontrol.FlowSchemaStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus(a.(*v1beta2.FlowSchemaStatus), b.(*flowcontrol.FlowSchemaStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.FlowSchemaStatus)(nil), (*v1beta2.FlowSchemaStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus(a.(*flowcontrol.FlowSchemaStatus), b.(*v1beta2.FlowSchemaStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.GroupSubject)(nil), (*flowcontrol.GroupSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_GroupSubject_To_flowcontrol_GroupSubject(a.(*v1beta2.GroupSubject), b.(*flowcontrol.GroupSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.GroupSubject)(nil), (*v1beta2.GroupSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_GroupSubject_To_v1beta2_GroupSubject(a.(*flowcontrol.GroupSubject), b.(*v1beta2.GroupSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.LimitResponse)(nil), (*flowcontrol.LimitResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse(a.(*v1beta2.LimitResponse), b.(*flowcontrol.LimitResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.LimitResponse)(nil), (*v1beta2.LimitResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse(a.(*flowcontrol.LimitResponse), b.(*v1beta2.LimitResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.LimitedPriorityLevelConfiguration)(nil), (*flowcontrol.LimitedPriorityLevelConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_LimitedPriorityLevelConfiguration_To_flowcontrol_LimitedPriorityLevelConfiguration(a.(*v1beta2.LimitedPriorityLevelConfiguration), b.(*flowcontrol.LimitedPriorityLevelConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.LimitedPriorityLevelConfiguration)(nil), (*v1beta2.LimitedPriorityLevelConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_LimitedPriorityLevelConfiguration_To_v1beta2_LimitedPriorityLevelConfiguration(a.(*flowcontrol.LimitedPriorityLevelConfiguration), b.(*v1beta2.LimitedPriorityLevelConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.NonResourcePolicyRule)(nil), (*flowcontrol.NonResourcePolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_NonResourcePolicyRule_To_flowcontrol_NonResourcePolicyRule(a.(*v1beta2.NonResourcePolicyRule), b.(*flowcontrol.NonResourcePolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.NonResourcePolicyRule)(nil), (*v1beta2.NonResourcePolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_NonResourcePolicyRule_To_v1beta2_NonResourcePolicyRule(a.(*flowcontrol.NonResourcePolicyRule), b.(*v1beta2.NonResourcePolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PolicyRulesWithSubjects)(nil), (*flowcontrol.PolicyRulesWithSubjects)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PolicyRulesWithSubjects_To_flowcontrol_PolicyRulesWithSubjects(a.(*v1beta2.PolicyRulesWithSubjects), b.(*flowcontrol.PolicyRulesWithSubjects), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PolicyRulesWithSubjects)(nil), (*v1beta2.PolicyRulesWithSubjects)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PolicyRulesWithSubjects_To_v1beta2_PolicyRulesWithSubjects(a.(*flowcontrol.PolicyRulesWithSubjects), b.(*v1beta2.PolicyRulesWithSubjects), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfiguration)(nil), (*flowcontrol.PriorityLevelConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfiguration_To_flowcontrol_PriorityLevelConfiguration(a.(*v1beta2.PriorityLevelConfiguration), b.(*flowcontrol.PriorityLevelConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfiguration)(nil), (*v1beta2.PriorityLevelConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfiguration_To_v1beta2_PriorityLevelConfiguration(a.(*flowcontrol.PriorityLevelConfiguration), b.(*v1beta2.PriorityLevelConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfigurationCondition)(nil), (*flowcontrol.PriorityLevelConfigurationCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfigurationCondition_To_flowcontrol_PriorityLevelConfigurationCondition(a.(*v1beta2.PriorityLevelConfigurationCondition), b.(*flowcontrol.PriorityLevelConfigurationCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfigurationCondition)(nil), (*v1beta2.PriorityLevelConfigurationCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfigurationCondition_To_v1beta2_PriorityLevelConfigurationCondition(a.(*flowcontrol.PriorityLevelConfigurationCondition), b.(*v1beta2.PriorityLevelConfigurationCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfigurationList)(nil), (*flowcontrol.PriorityLevelConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfigurationList_To_flowcontrol_PriorityLevelConfigurationList(a.(*v1beta2.PriorityLevelConfigurationList), b.(*flowcontrol.PriorityLevelConfigurationList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfigurationList)(nil), (*v1beta2.PriorityLevelConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfigurationList_To_v1beta2_PriorityLevelConfigurationList(a.(*flowcontrol.PriorityLevelConfigurationList), b.(*v1beta2.PriorityLevelConfigurationList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfigurationReference)(nil), (*flowcontrol.PriorityLevelConfigurationReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference(a.(*v1beta2.PriorityLevelConfigurationReference), b.(*flowcontrol.PriorityLevelConfigurationReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfigurationReference)(nil), (*v1beta2.PriorityLevelConfigurationReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference(a.(*flowcontrol.PriorityLevelConfigurationReference), b.(*v1beta2.PriorityLevelConfigurationReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfigurationSpec)(nil), (*flowcontrol.PriorityLevelConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec(a.(*v1beta2.PriorityLevelConfigurationSpec), b.(*flowcontrol.PriorityLevelConfigurationSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfigurationSpec)(nil), (*v1beta2.PriorityLevelConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec(a.(*flowcontrol.PriorityLevelConfigurationSpec), b.(*v1beta2.PriorityLevelConfigurationSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.PriorityLevelConfigurationStatus)(nil), (*flowcontrol.PriorityLevelConfigurationStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus(a.(*v1beta2.PriorityLevelConfigurationStatus), b.(*flowcontrol.PriorityLevelConfigurationStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.PriorityLevelConfigurationStatus)(nil), (*v1beta2.PriorityLevelConfigurationStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus(a.(*flowcontrol.PriorityLevelConfigurationStatus), b.(*v1beta2.PriorityLevelConfigurationStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.QueuingConfiguration)(nil), (*flowcontrol.QueuingConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_QueuingConfiguration_To_flowcontrol_QueuingConfiguration(a.(*v1beta2.QueuingConfiguration), b.(*flowcontrol.QueuingConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.QueuingConfiguration)(nil), (*v1beta2.QueuingConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_QueuingConfiguration_To_v1beta2_QueuingConfiguration(a.(*flowcontrol.QueuingConfiguration), b.(*v1beta2.QueuingConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.ResourcePolicyRule)(nil), (*flowcontrol.ResourcePolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_ResourcePolicyRule_To_flowcontrol_ResourcePolicyRule(a.(*v1beta2.ResourcePolicyRule), b.(*flowcontrol.ResourcePolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.ResourcePolicyRule)(nil), (*v1beta2.ResourcePolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_ResourcePolicyRule_To_v1beta2_ResourcePolicyRule(a.(*flowcontrol.ResourcePolicyRule), b.(*v1beta2.ResourcePolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.ServiceAccountSubject)(nil), (*flowcontrol.ServiceAccountSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_ServiceAccountSubject_To_flowcontrol_ServiceAccountSubject(a.(*v1beta2.ServiceAccountSubject), b.(*flowcontrol.ServiceAccountSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.ServiceAccountSubject)(nil), (*v1beta2.ServiceAccountSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_ServiceAccountSubject_To_v1beta2_ServiceAccountSubject(a.(*flowcontrol.ServiceAccountSubject), b.(*v1beta2.ServiceAccountSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.Subject)(nil), (*flowcontrol.Subject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_Subject_To_flowcontrol_Subject(a.(*v1beta2.Subject), b.(*flowcontrol.Subject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.Subject)(nil), (*v1beta2.Subject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_Subject_To_v1beta2_Subject(a.(*flowcontrol.Subject), b.(*v1beta2.Subject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta2.UserSubject)(nil), (*flowcontrol.UserSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta2_UserSubject_To_flowcontrol_UserSubject(a.(*v1beta2.UserSubject), b.(*flowcontrol.UserSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*flowcontrol.UserSubject)(nil), (*v1beta2.UserSubject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_flowcontrol_UserSubject_To_v1beta2_UserSubject(a.(*flowcontrol.UserSubject), b.(*v1beta2.UserSubject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowDistinguisherMethod_To_flowcontrol_FlowDistinguisherMethod(in *v1beta2.FlowDistinguisherMethod, out *flowcontrol.FlowDistinguisherMethod, s conversion.Scope) error {
|
||||
out.Type = flowcontrol.FlowDistinguisherMethodType(in.Type)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowDistinguisherMethod_To_flowcontrol_FlowDistinguisherMethod is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowDistinguisherMethod_To_flowcontrol_FlowDistinguisherMethod(in *v1beta2.FlowDistinguisherMethod, out *flowcontrol.FlowDistinguisherMethod, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowDistinguisherMethod_To_flowcontrol_FlowDistinguisherMethod(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowDistinguisherMethod_To_v1beta2_FlowDistinguisherMethod(in *flowcontrol.FlowDistinguisherMethod, out *v1beta2.FlowDistinguisherMethod, s conversion.Scope) error {
|
||||
out.Type = v1beta2.FlowDistinguisherMethodType(in.Type)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowDistinguisherMethod_To_v1beta2_FlowDistinguisherMethod is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowDistinguisherMethod_To_v1beta2_FlowDistinguisherMethod(in *flowcontrol.FlowDistinguisherMethod, out *v1beta2.FlowDistinguisherMethod, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowDistinguisherMethod_To_v1beta2_FlowDistinguisherMethod(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowSchema_To_flowcontrol_FlowSchema(in *v1beta2.FlowSchema, out *flowcontrol.FlowSchema, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowSchema_To_flowcontrol_FlowSchema is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowSchema_To_flowcontrol_FlowSchema(in *v1beta2.FlowSchema, out *flowcontrol.FlowSchema, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowSchema_To_flowcontrol_FlowSchema(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowSchema_To_v1beta2_FlowSchema(in *flowcontrol.FlowSchema, out *v1beta2.FlowSchema, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowSchema_To_v1beta2_FlowSchema is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowSchema_To_v1beta2_FlowSchema(in *flowcontrol.FlowSchema, out *v1beta2.FlowSchema, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowSchema_To_v1beta2_FlowSchema(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowSchemaCondition_To_flowcontrol_FlowSchemaCondition(in *v1beta2.FlowSchemaCondition, out *flowcontrol.FlowSchemaCondition, s conversion.Scope) error {
|
||||
out.Type = flowcontrol.FlowSchemaConditionType(in.Type)
|
||||
out.Status = flowcontrol.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowSchemaCondition_To_flowcontrol_FlowSchemaCondition is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowSchemaCondition_To_flowcontrol_FlowSchemaCondition(in *v1beta2.FlowSchemaCondition, out *flowcontrol.FlowSchemaCondition, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowSchemaCondition_To_flowcontrol_FlowSchemaCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowSchemaCondition_To_v1beta2_FlowSchemaCondition(in *flowcontrol.FlowSchemaCondition, out *v1beta2.FlowSchemaCondition, s conversion.Scope) error {
|
||||
out.Type = v1beta2.FlowSchemaConditionType(in.Type)
|
||||
out.Status = v1beta2.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowSchemaCondition_To_v1beta2_FlowSchemaCondition is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowSchemaCondition_To_v1beta2_FlowSchemaCondition(in *flowcontrol.FlowSchemaCondition, out *v1beta2.FlowSchemaCondition, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowSchemaCondition_To_v1beta2_FlowSchemaCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowSchemaList_To_flowcontrol_FlowSchemaList(in *v1beta2.FlowSchemaList, out *flowcontrol.FlowSchemaList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]flowcontrol.FlowSchema)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowSchemaList_To_flowcontrol_FlowSchemaList is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowSchemaList_To_flowcontrol_FlowSchemaList(in *v1beta2.FlowSchemaList, out *flowcontrol.FlowSchemaList, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowSchemaList_To_flowcontrol_FlowSchemaList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowSchemaList_To_v1beta2_FlowSchemaList(in *flowcontrol.FlowSchemaList, out *v1beta2.FlowSchemaList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1beta2.FlowSchema)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowSchemaList_To_v1beta2_FlowSchemaList is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowSchemaList_To_v1beta2_FlowSchemaList(in *flowcontrol.FlowSchemaList, out *v1beta2.FlowSchemaList, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowSchemaList_To_v1beta2_FlowSchemaList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec(in *v1beta2.FlowSchemaSpec, out *flowcontrol.FlowSchemaSpec, s conversion.Scope) error {
|
||||
if err := Convert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference(&in.PriorityLevelConfiguration, &out.PriorityLevelConfiguration, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MatchingPrecedence = in.MatchingPrecedence
|
||||
out.DistinguisherMethod = (*flowcontrol.FlowDistinguisherMethod)(unsafe.Pointer(in.DistinguisherMethod))
|
||||
out.Rules = *(*[]flowcontrol.PolicyRulesWithSubjects)(unsafe.Pointer(&in.Rules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec(in *v1beta2.FlowSchemaSpec, out *flowcontrol.FlowSchemaSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowSchemaSpec_To_flowcontrol_FlowSchemaSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec(in *flowcontrol.FlowSchemaSpec, out *v1beta2.FlowSchemaSpec, s conversion.Scope) error {
|
||||
if err := Convert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference(&in.PriorityLevelConfiguration, &out.PriorityLevelConfiguration, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MatchingPrecedence = in.MatchingPrecedence
|
||||
out.DistinguisherMethod = (*v1beta2.FlowDistinguisherMethod)(unsafe.Pointer(in.DistinguisherMethod))
|
||||
out.Rules = *(*[]v1beta2.PolicyRulesWithSubjects)(unsafe.Pointer(&in.Rules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec(in *flowcontrol.FlowSchemaSpec, out *v1beta2.FlowSchemaSpec, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowSchemaSpec_To_v1beta2_FlowSchemaSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus(in *v1beta2.FlowSchemaStatus, out *flowcontrol.FlowSchemaStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]flowcontrol.FlowSchemaCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus is an autogenerated conversion function.
|
||||
func Convert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus(in *v1beta2.FlowSchemaStatus, out *flowcontrol.FlowSchemaStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_FlowSchemaStatus_To_flowcontrol_FlowSchemaStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus(in *flowcontrol.FlowSchemaStatus, out *v1beta2.FlowSchemaStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]v1beta2.FlowSchemaCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus(in *flowcontrol.FlowSchemaStatus, out *v1beta2.FlowSchemaStatus, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_FlowSchemaStatus_To_v1beta2_FlowSchemaStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_GroupSubject_To_flowcontrol_GroupSubject(in *v1beta2.GroupSubject, out *flowcontrol.GroupSubject, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_GroupSubject_To_flowcontrol_GroupSubject is an autogenerated conversion function.
|
||||
func Convert_v1beta2_GroupSubject_To_flowcontrol_GroupSubject(in *v1beta2.GroupSubject, out *flowcontrol.GroupSubject, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_GroupSubject_To_flowcontrol_GroupSubject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_GroupSubject_To_v1beta2_GroupSubject(in *flowcontrol.GroupSubject, out *v1beta2.GroupSubject, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_GroupSubject_To_v1beta2_GroupSubject is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_GroupSubject_To_v1beta2_GroupSubject(in *flowcontrol.GroupSubject, out *v1beta2.GroupSubject, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_GroupSubject_To_v1beta2_GroupSubject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse(in *v1beta2.LimitResponse, out *flowcontrol.LimitResponse, s conversion.Scope) error {
|
||||
out.Type = flowcontrol.LimitResponseType(in.Type)
|
||||
out.Queuing = (*flowcontrol.QueuingConfiguration)(unsafe.Pointer(in.Queuing))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse(in *v1beta2.LimitResponse, out *flowcontrol.LimitResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse(in *flowcontrol.LimitResponse, out *v1beta2.LimitResponse, s conversion.Scope) error {
|
||||
out.Type = v1beta2.LimitResponseType(in.Type)
|
||||
out.Queuing = (*v1beta2.QueuingConfiguration)(unsafe.Pointer(in.Queuing))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse(in *flowcontrol.LimitResponse, out *v1beta2.LimitResponse, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_LimitedPriorityLevelConfiguration_To_flowcontrol_LimitedPriorityLevelConfiguration(in *v1beta2.LimitedPriorityLevelConfiguration, out *flowcontrol.LimitedPriorityLevelConfiguration, s conversion.Scope) error {
|
||||
out.AssuredConcurrencyShares = in.AssuredConcurrencyShares
|
||||
if err := Convert_v1beta2_LimitResponse_To_flowcontrol_LimitResponse(&in.LimitResponse, &out.LimitResponse, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_LimitedPriorityLevelConfiguration_To_flowcontrol_LimitedPriorityLevelConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1beta2_LimitedPriorityLevelConfiguration_To_flowcontrol_LimitedPriorityLevelConfiguration(in *v1beta2.LimitedPriorityLevelConfiguration, out *flowcontrol.LimitedPriorityLevelConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_LimitedPriorityLevelConfiguration_To_flowcontrol_LimitedPriorityLevelConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_LimitedPriorityLevelConfiguration_To_v1beta2_LimitedPriorityLevelConfiguration(in *flowcontrol.LimitedPriorityLevelConfiguration, out *v1beta2.LimitedPriorityLevelConfiguration, s conversion.Scope) error {
|
||||
out.AssuredConcurrencyShares = in.AssuredConcurrencyShares
|
||||
if err := Convert_flowcontrol_LimitResponse_To_v1beta2_LimitResponse(&in.LimitResponse, &out.LimitResponse, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_LimitedPriorityLevelConfiguration_To_v1beta2_LimitedPriorityLevelConfiguration is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_LimitedPriorityLevelConfiguration_To_v1beta2_LimitedPriorityLevelConfiguration(in *flowcontrol.LimitedPriorityLevelConfiguration, out *v1beta2.LimitedPriorityLevelConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_LimitedPriorityLevelConfiguration_To_v1beta2_LimitedPriorityLevelConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_NonResourcePolicyRule_To_flowcontrol_NonResourcePolicyRule(in *v1beta2.NonResourcePolicyRule, out *flowcontrol.NonResourcePolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_NonResourcePolicyRule_To_flowcontrol_NonResourcePolicyRule is an autogenerated conversion function.
|
||||
func Convert_v1beta2_NonResourcePolicyRule_To_flowcontrol_NonResourcePolicyRule(in *v1beta2.NonResourcePolicyRule, out *flowcontrol.NonResourcePolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_NonResourcePolicyRule_To_flowcontrol_NonResourcePolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_NonResourcePolicyRule_To_v1beta2_NonResourcePolicyRule(in *flowcontrol.NonResourcePolicyRule, out *v1beta2.NonResourcePolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_NonResourcePolicyRule_To_v1beta2_NonResourcePolicyRule is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_NonResourcePolicyRule_To_v1beta2_NonResourcePolicyRule(in *flowcontrol.NonResourcePolicyRule, out *v1beta2.NonResourcePolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_NonResourcePolicyRule_To_v1beta2_NonResourcePolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PolicyRulesWithSubjects_To_flowcontrol_PolicyRulesWithSubjects(in *v1beta2.PolicyRulesWithSubjects, out *flowcontrol.PolicyRulesWithSubjects, s conversion.Scope) error {
|
||||
out.Subjects = *(*[]flowcontrol.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
out.ResourceRules = *(*[]flowcontrol.ResourcePolicyRule)(unsafe.Pointer(&in.ResourceRules))
|
||||
out.NonResourceRules = *(*[]flowcontrol.NonResourcePolicyRule)(unsafe.Pointer(&in.NonResourceRules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PolicyRulesWithSubjects_To_flowcontrol_PolicyRulesWithSubjects is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PolicyRulesWithSubjects_To_flowcontrol_PolicyRulesWithSubjects(in *v1beta2.PolicyRulesWithSubjects, out *flowcontrol.PolicyRulesWithSubjects, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PolicyRulesWithSubjects_To_flowcontrol_PolicyRulesWithSubjects(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PolicyRulesWithSubjects_To_v1beta2_PolicyRulesWithSubjects(in *flowcontrol.PolicyRulesWithSubjects, out *v1beta2.PolicyRulesWithSubjects, s conversion.Scope) error {
|
||||
out.Subjects = *(*[]v1beta2.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
out.ResourceRules = *(*[]v1beta2.ResourcePolicyRule)(unsafe.Pointer(&in.ResourceRules))
|
||||
out.NonResourceRules = *(*[]v1beta2.NonResourcePolicyRule)(unsafe.Pointer(&in.NonResourceRules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PolicyRulesWithSubjects_To_v1beta2_PolicyRulesWithSubjects is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PolicyRulesWithSubjects_To_v1beta2_PolicyRulesWithSubjects(in *flowcontrol.PolicyRulesWithSubjects, out *v1beta2.PolicyRulesWithSubjects, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PolicyRulesWithSubjects_To_v1beta2_PolicyRulesWithSubjects(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfiguration_To_flowcontrol_PriorityLevelConfiguration(in *v1beta2.PriorityLevelConfiguration, out *flowcontrol.PriorityLevelConfiguration, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfiguration_To_flowcontrol_PriorityLevelConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfiguration_To_flowcontrol_PriorityLevelConfiguration(in *v1beta2.PriorityLevelConfiguration, out *flowcontrol.PriorityLevelConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfiguration_To_flowcontrol_PriorityLevelConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfiguration_To_v1beta2_PriorityLevelConfiguration(in *flowcontrol.PriorityLevelConfiguration, out *v1beta2.PriorityLevelConfiguration, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfiguration_To_v1beta2_PriorityLevelConfiguration is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfiguration_To_v1beta2_PriorityLevelConfiguration(in *flowcontrol.PriorityLevelConfiguration, out *v1beta2.PriorityLevelConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfiguration_To_v1beta2_PriorityLevelConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfigurationCondition_To_flowcontrol_PriorityLevelConfigurationCondition(in *v1beta2.PriorityLevelConfigurationCondition, out *flowcontrol.PriorityLevelConfigurationCondition, s conversion.Scope) error {
|
||||
out.Type = flowcontrol.PriorityLevelConfigurationConditionType(in.Type)
|
||||
out.Status = flowcontrol.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfigurationCondition_To_flowcontrol_PriorityLevelConfigurationCondition is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfigurationCondition_To_flowcontrol_PriorityLevelConfigurationCondition(in *v1beta2.PriorityLevelConfigurationCondition, out *flowcontrol.PriorityLevelConfigurationCondition, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfigurationCondition_To_flowcontrol_PriorityLevelConfigurationCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfigurationCondition_To_v1beta2_PriorityLevelConfigurationCondition(in *flowcontrol.PriorityLevelConfigurationCondition, out *v1beta2.PriorityLevelConfigurationCondition, s conversion.Scope) error {
|
||||
out.Type = v1beta2.PriorityLevelConfigurationConditionType(in.Type)
|
||||
out.Status = v1beta2.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfigurationCondition_To_v1beta2_PriorityLevelConfigurationCondition is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfigurationCondition_To_v1beta2_PriorityLevelConfigurationCondition(in *flowcontrol.PriorityLevelConfigurationCondition, out *v1beta2.PriorityLevelConfigurationCondition, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfigurationCondition_To_v1beta2_PriorityLevelConfigurationCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfigurationList_To_flowcontrol_PriorityLevelConfigurationList(in *v1beta2.PriorityLevelConfigurationList, out *flowcontrol.PriorityLevelConfigurationList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]flowcontrol.PriorityLevelConfiguration)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfigurationList_To_flowcontrol_PriorityLevelConfigurationList is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfigurationList_To_flowcontrol_PriorityLevelConfigurationList(in *v1beta2.PriorityLevelConfigurationList, out *flowcontrol.PriorityLevelConfigurationList, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfigurationList_To_flowcontrol_PriorityLevelConfigurationList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfigurationList_To_v1beta2_PriorityLevelConfigurationList(in *flowcontrol.PriorityLevelConfigurationList, out *v1beta2.PriorityLevelConfigurationList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1beta2.PriorityLevelConfiguration)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfigurationList_To_v1beta2_PriorityLevelConfigurationList is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfigurationList_To_v1beta2_PriorityLevelConfigurationList(in *flowcontrol.PriorityLevelConfigurationList, out *v1beta2.PriorityLevelConfigurationList, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfigurationList_To_v1beta2_PriorityLevelConfigurationList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference(in *v1beta2.PriorityLevelConfigurationReference, out *flowcontrol.PriorityLevelConfigurationReference, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference(in *v1beta2.PriorityLevelConfigurationReference, out *flowcontrol.PriorityLevelConfigurationReference, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfigurationReference_To_flowcontrol_PriorityLevelConfigurationReference(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference(in *flowcontrol.PriorityLevelConfigurationReference, out *v1beta2.PriorityLevelConfigurationReference, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference(in *flowcontrol.PriorityLevelConfigurationReference, out *v1beta2.PriorityLevelConfigurationReference, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfigurationReference_To_v1beta2_PriorityLevelConfigurationReference(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec(in *v1beta2.PriorityLevelConfigurationSpec, out *flowcontrol.PriorityLevelConfigurationSpec, s conversion.Scope) error {
|
||||
out.Type = flowcontrol.PriorityLevelEnablement(in.Type)
|
||||
out.Limited = (*flowcontrol.LimitedPriorityLevelConfiguration)(unsafe.Pointer(in.Limited))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec(in *v1beta2.PriorityLevelConfigurationSpec, out *flowcontrol.PriorityLevelConfigurationSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfigurationSpec_To_flowcontrol_PriorityLevelConfigurationSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec(in *flowcontrol.PriorityLevelConfigurationSpec, out *v1beta2.PriorityLevelConfigurationSpec, s conversion.Scope) error {
|
||||
out.Type = v1beta2.PriorityLevelEnablement(in.Type)
|
||||
out.Limited = (*v1beta2.LimitedPriorityLevelConfiguration)(unsafe.Pointer(in.Limited))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec(in *flowcontrol.PriorityLevelConfigurationSpec, out *v1beta2.PriorityLevelConfigurationSpec, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfigurationSpec_To_v1beta2_PriorityLevelConfigurationSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus(in *v1beta2.PriorityLevelConfigurationStatus, out *flowcontrol.PriorityLevelConfigurationStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]flowcontrol.PriorityLevelConfigurationCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus is an autogenerated conversion function.
|
||||
func Convert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus(in *v1beta2.PriorityLevelConfigurationStatus, out *flowcontrol.PriorityLevelConfigurationStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_PriorityLevelConfigurationStatus_To_flowcontrol_PriorityLevelConfigurationStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus(in *flowcontrol.PriorityLevelConfigurationStatus, out *v1beta2.PriorityLevelConfigurationStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]v1beta2.PriorityLevelConfigurationCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus(in *flowcontrol.PriorityLevelConfigurationStatus, out *v1beta2.PriorityLevelConfigurationStatus, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_PriorityLevelConfigurationStatus_To_v1beta2_PriorityLevelConfigurationStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_QueuingConfiguration_To_flowcontrol_QueuingConfiguration(in *v1beta2.QueuingConfiguration, out *flowcontrol.QueuingConfiguration, s conversion.Scope) error {
|
||||
out.Queues = in.Queues
|
||||
out.HandSize = in.HandSize
|
||||
out.QueueLengthLimit = in.QueueLengthLimit
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_QueuingConfiguration_To_flowcontrol_QueuingConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1beta2_QueuingConfiguration_To_flowcontrol_QueuingConfiguration(in *v1beta2.QueuingConfiguration, out *flowcontrol.QueuingConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_QueuingConfiguration_To_flowcontrol_QueuingConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_QueuingConfiguration_To_v1beta2_QueuingConfiguration(in *flowcontrol.QueuingConfiguration, out *v1beta2.QueuingConfiguration, s conversion.Scope) error {
|
||||
out.Queues = in.Queues
|
||||
out.HandSize = in.HandSize
|
||||
out.QueueLengthLimit = in.QueueLengthLimit
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_QueuingConfiguration_To_v1beta2_QueuingConfiguration is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_QueuingConfiguration_To_v1beta2_QueuingConfiguration(in *flowcontrol.QueuingConfiguration, out *v1beta2.QueuingConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_QueuingConfiguration_To_v1beta2_QueuingConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_ResourcePolicyRule_To_flowcontrol_ResourcePolicyRule(in *v1beta2.ResourcePolicyRule, out *flowcontrol.ResourcePolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||
out.ClusterScope = in.ClusterScope
|
||||
out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_ResourcePolicyRule_To_flowcontrol_ResourcePolicyRule is an autogenerated conversion function.
|
||||
func Convert_v1beta2_ResourcePolicyRule_To_flowcontrol_ResourcePolicyRule(in *v1beta2.ResourcePolicyRule, out *flowcontrol.ResourcePolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_ResourcePolicyRule_To_flowcontrol_ResourcePolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_ResourcePolicyRule_To_v1beta2_ResourcePolicyRule(in *flowcontrol.ResourcePolicyRule, out *v1beta2.ResourcePolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||
out.ClusterScope = in.ClusterScope
|
||||
out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_ResourcePolicyRule_To_v1beta2_ResourcePolicyRule is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_ResourcePolicyRule_To_v1beta2_ResourcePolicyRule(in *flowcontrol.ResourcePolicyRule, out *v1beta2.ResourcePolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_ResourcePolicyRule_To_v1beta2_ResourcePolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_ServiceAccountSubject_To_flowcontrol_ServiceAccountSubject(in *v1beta2.ServiceAccountSubject, out *flowcontrol.ServiceAccountSubject, s conversion.Scope) error {
|
||||
out.Namespace = in.Namespace
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_ServiceAccountSubject_To_flowcontrol_ServiceAccountSubject is an autogenerated conversion function.
|
||||
func Convert_v1beta2_ServiceAccountSubject_To_flowcontrol_ServiceAccountSubject(in *v1beta2.ServiceAccountSubject, out *flowcontrol.ServiceAccountSubject, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_ServiceAccountSubject_To_flowcontrol_ServiceAccountSubject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_ServiceAccountSubject_To_v1beta2_ServiceAccountSubject(in *flowcontrol.ServiceAccountSubject, out *v1beta2.ServiceAccountSubject, s conversion.Scope) error {
|
||||
out.Namespace = in.Namespace
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_ServiceAccountSubject_To_v1beta2_ServiceAccountSubject is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_ServiceAccountSubject_To_v1beta2_ServiceAccountSubject(in *flowcontrol.ServiceAccountSubject, out *v1beta2.ServiceAccountSubject, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_ServiceAccountSubject_To_v1beta2_ServiceAccountSubject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_Subject_To_flowcontrol_Subject(in *v1beta2.Subject, out *flowcontrol.Subject, s conversion.Scope) error {
|
||||
out.Kind = flowcontrol.SubjectKind(in.Kind)
|
||||
out.User = (*flowcontrol.UserSubject)(unsafe.Pointer(in.User))
|
||||
out.Group = (*flowcontrol.GroupSubject)(unsafe.Pointer(in.Group))
|
||||
out.ServiceAccount = (*flowcontrol.ServiceAccountSubject)(unsafe.Pointer(in.ServiceAccount))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_Subject_To_flowcontrol_Subject is an autogenerated conversion function.
|
||||
func Convert_v1beta2_Subject_To_flowcontrol_Subject(in *v1beta2.Subject, out *flowcontrol.Subject, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_Subject_To_flowcontrol_Subject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_Subject_To_v1beta2_Subject(in *flowcontrol.Subject, out *v1beta2.Subject, s conversion.Scope) error {
|
||||
out.Kind = v1beta2.SubjectKind(in.Kind)
|
||||
out.User = (*v1beta2.UserSubject)(unsafe.Pointer(in.User))
|
||||
out.Group = (*v1beta2.GroupSubject)(unsafe.Pointer(in.Group))
|
||||
out.ServiceAccount = (*v1beta2.ServiceAccountSubject)(unsafe.Pointer(in.ServiceAccount))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_Subject_To_v1beta2_Subject is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_Subject_To_v1beta2_Subject(in *flowcontrol.Subject, out *v1beta2.Subject, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_Subject_To_v1beta2_Subject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta2_UserSubject_To_flowcontrol_UserSubject(in *v1beta2.UserSubject, out *flowcontrol.UserSubject, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta2_UserSubject_To_flowcontrol_UserSubject is an autogenerated conversion function.
|
||||
func Convert_v1beta2_UserSubject_To_flowcontrol_UserSubject(in *v1beta2.UserSubject, out *flowcontrol.UserSubject, s conversion.Scope) error {
|
||||
return autoConvert_v1beta2_UserSubject_To_flowcontrol_UserSubject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_flowcontrol_UserSubject_To_v1beta2_UserSubject(in *flowcontrol.UserSubject, out *v1beta2.UserSubject, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_flowcontrol_UserSubject_To_v1beta2_UserSubject is an autogenerated conversion function.
|
||||
func Convert_flowcontrol_UserSubject_To_v1beta2_UserSubject(in *flowcontrol.UserSubject, out *v1beta2.UserSubject, s conversion.Scope) error {
|
||||
return autoConvert_flowcontrol_UserSubject_To_v1beta2_UserSubject(in, out, s)
|
||||
}
|
69
pkg/apis/flowcontrol/v1beta2/zz_generated.defaults.go
generated
Normal file
69
pkg/apis/flowcontrol/v1beta2/zz_generated.defaults.go
generated
Normal file
@ -0,0 +1,69 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1beta2.FlowSchema{}, func(obj interface{}) { SetObjectDefaults_FlowSchema(obj.(*v1beta2.FlowSchema)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta2.FlowSchemaList{}, func(obj interface{}) { SetObjectDefaults_FlowSchemaList(obj.(*v1beta2.FlowSchemaList)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta2.PriorityLevelConfiguration{}, func(obj interface{}) {
|
||||
SetObjectDefaults_PriorityLevelConfiguration(obj.(*v1beta2.PriorityLevelConfiguration))
|
||||
})
|
||||
scheme.AddTypeDefaultingFunc(&v1beta2.PriorityLevelConfigurationList{}, func(obj interface{}) {
|
||||
SetObjectDefaults_PriorityLevelConfigurationList(obj.(*v1beta2.PriorityLevelConfigurationList))
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_FlowSchema(in *v1beta2.FlowSchema) {
|
||||
SetDefaults_FlowSchemaSpec(&in.Spec)
|
||||
}
|
||||
|
||||
func SetObjectDefaults_FlowSchemaList(in *v1beta2.FlowSchemaList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_FlowSchema(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_PriorityLevelConfiguration(in *v1beta2.PriorityLevelConfiguration) {
|
||||
if in.Spec.Limited != nil {
|
||||
SetDefaults_LimitedPriorityLevelConfiguration(in.Spec.Limited)
|
||||
if in.Spec.Limited.LimitResponse.Queuing != nil {
|
||||
SetDefaults_QueuingConfiguration(in.Spec.Limited.LimitResponse.Queuing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_PriorityLevelConfigurationList(in *v1beta2.PriorityLevelConfigurationList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_PriorityLevelConfiguration(a)
|
||||
}
|
||||
}
|
@ -75,6 +75,7 @@ import (
|
||||
"k8s.io/klog/v2"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
flowcontrolv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
"k8s.io/kubernetes/pkg/controlplane/controller/apiserverleasegc"
|
||||
"k8s.io/kubernetes/pkg/controlplane/controller/clusterauthenticationtrust"
|
||||
"k8s.io/kubernetes/pkg/controlplane/reconcilers"
|
||||
@ -654,6 +655,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
|
||||
storageapiv1.SchemeGroupVersion,
|
||||
storageapiv1beta1.SchemeGroupVersion,
|
||||
schedulingapiv1.SchemeGroupVersion,
|
||||
flowcontrolv1beta2.SchemeGroupVersion,
|
||||
flowcontrolv1beta1.SchemeGroupVersion,
|
||||
)
|
||||
// disable alpha versions explicitly so we have a full list of what's possible to serve
|
||||
|
@ -88,6 +88,8 @@ var GVRToStorageVersionHash = map[string]string{
|
||||
"admissionregistration.k8s.io/v1/validatingwebhookconfigurations": "B0wHjQmsGNk=",
|
||||
"events.k8s.io/v1/events": "r2yiGXH7wu8=",
|
||||
"events.k8s.io/v1beta1/events": "r2yiGXH7wu8=",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2/flowschemas": "9bSnTLYweJ0=",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations": "BFVwf8eYnsw=",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta1/flowschemas": "9bSnTLYweJ0=",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations": "BFVwf8eYnsw=",
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import (
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
@ -560,9 +560,9 @@ func AddHandlers(h printers.PrintHandler) {
|
||||
|
||||
flowSchemaColumnDefinitions := []metav1.TableColumnDefinition{
|
||||
{Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]},
|
||||
{Name: "PriorityLevel", Type: "string", Description: flowcontrolv1beta1.PriorityLevelConfigurationReference{}.SwaggerDoc()["name"]},
|
||||
{Name: "MatchingPrecedence", Type: "string", Description: flowcontrolv1beta1.FlowSchemaSpec{}.SwaggerDoc()["matchingPrecedence"]},
|
||||
{Name: "DistinguisherMethod", Type: "string", Description: flowcontrolv1beta1.FlowSchemaSpec{}.SwaggerDoc()["distinguisherMethod"]},
|
||||
{Name: "PriorityLevel", Type: "string", Description: flowcontrolv1beta2.PriorityLevelConfigurationReference{}.SwaggerDoc()["name"]},
|
||||
{Name: "MatchingPrecedence", Type: "string", Description: flowcontrolv1beta2.FlowSchemaSpec{}.SwaggerDoc()["matchingPrecedence"]},
|
||||
{Name: "DistinguisherMethod", Type: "string", Description: flowcontrolv1beta2.FlowSchemaSpec{}.SwaggerDoc()["distinguisherMethod"]},
|
||||
{Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]},
|
||||
{Name: "MissingPL", Type: "string", Description: "references a broken or non-existent PriorityLevelConfiguration"},
|
||||
}
|
||||
@ -571,11 +571,11 @@ func AddHandlers(h printers.PrintHandler) {
|
||||
|
||||
priorityLevelColumnDefinitions := []metav1.TableColumnDefinition{
|
||||
{Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]},
|
||||
{Name: "Type", Type: "string", Description: flowcontrolv1beta1.PriorityLevelConfigurationSpec{}.SwaggerDoc()["type"]},
|
||||
{Name: "AssuredConcurrencyShares", Type: "string", Description: flowcontrolv1beta1.LimitedPriorityLevelConfiguration{}.SwaggerDoc()["assuredConcurrencyShares"]},
|
||||
{Name: "Queues", Type: "string", Description: flowcontrolv1beta1.QueuingConfiguration{}.SwaggerDoc()["queues"]},
|
||||
{Name: "HandSize", Type: "string", Description: flowcontrolv1beta1.QueuingConfiguration{}.SwaggerDoc()["handSize"]},
|
||||
{Name: "QueueLengthLimit", Type: "string", Description: flowcontrolv1beta1.QueuingConfiguration{}.SwaggerDoc()["queueLengthLimit"]},
|
||||
{Name: "Type", Type: "string", Description: flowcontrolv1beta2.PriorityLevelConfigurationSpec{}.SwaggerDoc()["type"]},
|
||||
{Name: "AssuredConcurrencyShares", Type: "string", Description: flowcontrolv1beta2.LimitedPriorityLevelConfiguration{}.SwaggerDoc()["assuredConcurrencyShares"]},
|
||||
{Name: "Queues", Type: "string", Description: flowcontrolv1beta2.QueuingConfiguration{}.SwaggerDoc()["queues"]},
|
||||
{Name: "HandSize", Type: "string", Description: flowcontrolv1beta2.QueuingConfiguration{}.SwaggerDoc()["handSize"]},
|
||||
{Name: "QueueLengthLimit", Type: "string", Description: flowcontrolv1beta2.QueuingConfiguration{}.SwaggerDoc()["queueLengthLimit"]},
|
||||
{Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]},
|
||||
}
|
||||
h.TableHandler(priorityLevelColumnDefinitions, printPriorityLevelConfiguration)
|
||||
|
@ -21,13 +21,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolapisv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
flowcontrolapisv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -36,7 +36,7 @@ var (
|
||||
|
||||
// FlowSchemaEnsurer ensures the specified bootstrap configuration objects
|
||||
type FlowSchemaEnsurer interface {
|
||||
Ensure([]*flowcontrolv1beta1.FlowSchema) error
|
||||
Ensure([]*flowcontrolv1beta2.FlowSchema) error
|
||||
}
|
||||
|
||||
// FlowSchemaRemover removes the specified bootstrap configuration objects
|
||||
@ -82,7 +82,7 @@ func NewFlowSchemaRemover(client flowcontrolclient.FlowSchemaInterface) FlowSche
|
||||
// names that are candidates for deletion from the cluster.
|
||||
// bootstrap: a set of hard coded FlowSchema configuration objects
|
||||
// kube-apiserver maintains in-memory.
|
||||
func GetFlowSchemaRemoveCandidate(client flowcontrolclient.FlowSchemaInterface, bootstrap []*flowcontrolv1beta1.FlowSchema) ([]string, error) {
|
||||
func GetFlowSchemaRemoveCandidate(client flowcontrolclient.FlowSchemaInterface, bootstrap []*flowcontrolv1beta2.FlowSchema) ([]string, error) {
|
||||
// TODO(101667): Use a lister here to avoid periodic LIST calls
|
||||
fsList, err := client.List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
@ -107,7 +107,7 @@ type fsEnsurer struct {
|
||||
wrapper configurationWrapper
|
||||
}
|
||||
|
||||
func (e *fsEnsurer) Ensure(flowSchemas []*flowcontrolv1beta1.FlowSchema) error {
|
||||
func (e *fsEnsurer) Ensure(flowSchemas []*flowcontrolv1beta2.FlowSchema) error {
|
||||
for _, flowSchema := range flowSchemas {
|
||||
if err := ensureConfiguration(e.wrapper, e.strategy, flowSchema); err != nil {
|
||||
return err
|
||||
@ -138,7 +138,7 @@ func (fs *flowSchemaWrapper) TypeName() string {
|
||||
}
|
||||
|
||||
func (fs *flowSchemaWrapper) Create(object runtime.Object) (runtime.Object, error) {
|
||||
fsObject, ok := object.(*flowcontrolv1beta1.FlowSchema)
|
||||
fsObject, ok := object.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return nil, errObjectNotFlowSchema
|
||||
}
|
||||
@ -147,7 +147,7 @@ func (fs *flowSchemaWrapper) Create(object runtime.Object) (runtime.Object, erro
|
||||
}
|
||||
|
||||
func (fs *flowSchemaWrapper) Update(object runtime.Object) (runtime.Object, error) {
|
||||
fsObject, ok := object.(*flowcontrolv1beta1.FlowSchema)
|
||||
fsObject, ok := object.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return nil, errObjectNotFlowSchema
|
||||
}
|
||||
@ -164,11 +164,11 @@ func (fs *flowSchemaWrapper) Delete(name string) error {
|
||||
}
|
||||
|
||||
func (fs *flowSchemaWrapper) CopySpec(bootstrap, current runtime.Object) error {
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta1.FlowSchema)
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return errObjectNotFlowSchema
|
||||
}
|
||||
currentFS, ok := current.(*flowcontrolv1beta1.FlowSchema)
|
||||
currentFS, ok := current.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return errObjectNotFlowSchema
|
||||
}
|
||||
@ -179,11 +179,11 @@ func (fs *flowSchemaWrapper) CopySpec(bootstrap, current runtime.Object) error {
|
||||
}
|
||||
|
||||
func (fs *flowSchemaWrapper) HasSpecChanged(bootstrap, current runtime.Object) (bool, error) {
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta1.FlowSchema)
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return false, errObjectNotFlowSchema
|
||||
}
|
||||
currentFS, ok := current.(*flowcontrolv1beta1.FlowSchema)
|
||||
currentFS, ok := current.(*flowcontrolv1beta2.FlowSchema)
|
||||
if !ok {
|
||||
return false, errObjectNotFlowSchema
|
||||
}
|
||||
@ -191,8 +191,8 @@ func (fs *flowSchemaWrapper) HasSpecChanged(bootstrap, current runtime.Object) (
|
||||
return flowSchemaSpecChanged(bootstrapFS, currentFS), nil
|
||||
}
|
||||
|
||||
func flowSchemaSpecChanged(expected, actual *flowcontrolv1beta1.FlowSchema) bool {
|
||||
func flowSchemaSpecChanged(expected, actual *flowcontrolv1beta2.FlowSchema) bool {
|
||||
copiedExpectedFlowSchema := expected.DeepCopy()
|
||||
flowcontrolapisv1beta1.SetObjectDefaults_FlowSchema(copiedExpectedFlowSchema)
|
||||
flowcontrolapisv1beta2.SetObjectDefaults_FlowSchema(copiedExpectedFlowSchema)
|
||||
return !equality.Semantic.DeepEqual(copiedExpectedFlowSchema.Spec, actual.Spec)
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolapisv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
flowcontrolapisv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -37,9 +37,9 @@ func TestEnsureFlowSchema(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
strategy func(flowcontrolclient.FlowSchemaInterface) FlowSchemaEnsurer
|
||||
current *flowcontrolv1beta1.FlowSchema
|
||||
bootstrap *flowcontrolv1beta1.FlowSchema
|
||||
expected *flowcontrolv1beta1.FlowSchema
|
||||
current *flowcontrolv1beta2.FlowSchema
|
||||
bootstrap *flowcontrolv1beta2.FlowSchema
|
||||
expected *flowcontrolv1beta2.FlowSchema
|
||||
}{
|
||||
// for suggested configurations
|
||||
{
|
||||
@ -102,14 +102,14 @@ func TestEnsureFlowSchema(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().FlowSchemas()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().FlowSchemas()
|
||||
if test.current != nil {
|
||||
client.Create(context.TODO(), test.current, metav1.CreateOptions{})
|
||||
}
|
||||
|
||||
ensurer := test.strategy(client)
|
||||
|
||||
err := ensurer.Ensure([]*flowcontrolv1beta1.FlowSchema{test.bootstrap})
|
||||
err := ensurer.Ensure([]*flowcontrolv1beta2.FlowSchema{test.bootstrap})
|
||||
if err != nil {
|
||||
t.Fatalf("Expected no error, but got: %v", err)
|
||||
}
|
||||
@ -134,9 +134,9 @@ func TestEnsureFlowSchema(t *testing.T) {
|
||||
func TestSuggestedFSEnsureStrategy_ShouldUpdate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current *flowcontrolv1beta1.FlowSchema
|
||||
bootstrap *flowcontrolv1beta1.FlowSchema
|
||||
newObjectExpected *flowcontrolv1beta1.FlowSchema
|
||||
current *flowcontrolv1beta2.FlowSchema
|
||||
bootstrap *flowcontrolv1beta2.FlowSchema
|
||||
newObjectExpected *flowcontrolv1beta2.FlowSchema
|
||||
}{
|
||||
{
|
||||
name: "auto update is enabled, first generation, spec does not match - spec update expected",
|
||||
@ -241,23 +241,23 @@ func TestSuggestedFSEnsureStrategy_ShouldUpdate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFlowSchemaSpecChanged(t *testing.T) {
|
||||
fs1 := &flowcontrolv1beta1.FlowSchema{
|
||||
Spec: flowcontrolv1beta1.FlowSchemaSpec{},
|
||||
fs1 := &flowcontrolv1beta2.FlowSchema{
|
||||
Spec: flowcontrolv1beta2.FlowSchemaSpec{},
|
||||
}
|
||||
fs2 := &flowcontrolv1beta1.FlowSchema{
|
||||
Spec: flowcontrolv1beta1.FlowSchemaSpec{
|
||||
fs2 := &flowcontrolv1beta2.FlowSchema{
|
||||
Spec: flowcontrolv1beta2.FlowSchemaSpec{
|
||||
MatchingPrecedence: 1,
|
||||
},
|
||||
}
|
||||
fs1Defaulted := &flowcontrolv1beta1.FlowSchema{
|
||||
Spec: flowcontrolv1beta1.FlowSchemaSpec{
|
||||
MatchingPrecedence: flowcontrolapisv1beta1.FlowSchemaDefaultMatchingPrecedence,
|
||||
fs1Defaulted := &flowcontrolv1beta2.FlowSchema{
|
||||
Spec: flowcontrolv1beta2.FlowSchemaSpec{
|
||||
MatchingPrecedence: flowcontrolapisv1beta2.FlowSchemaDefaultMatchingPrecedence,
|
||||
},
|
||||
}
|
||||
testCases := []struct {
|
||||
name string
|
||||
expected *flowcontrolv1beta1.FlowSchema
|
||||
actual *flowcontrolv1beta1.FlowSchema
|
||||
expected *flowcontrolv1beta2.FlowSchema
|
||||
actual *flowcontrolv1beta2.FlowSchema
|
||||
specChanged bool
|
||||
}{
|
||||
{
|
||||
@ -290,7 +290,7 @@ func TestFlowSchemaSpecChanged(t *testing.T) {
|
||||
func TestRemoveFlowSchema(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current *flowcontrolv1beta1.FlowSchema
|
||||
current *flowcontrolv1beta2.FlowSchema
|
||||
bootstrapName string
|
||||
removeExpected bool
|
||||
}{
|
||||
@ -321,7 +321,7 @@ func TestRemoveFlowSchema(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().FlowSchemas()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().FlowSchemas()
|
||||
if test.current != nil {
|
||||
client.Create(context.TODO(), test.current, metav1.CreateOptions{})
|
||||
}
|
||||
@ -353,18 +353,18 @@ func TestRemoveFlowSchema(t *testing.T) {
|
||||
func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current []*flowcontrolv1beta1.FlowSchema
|
||||
bootstrap []*flowcontrolv1beta1.FlowSchema
|
||||
current []*flowcontrolv1beta2.FlowSchema
|
||||
bootstrap []*flowcontrolv1beta2.FlowSchema
|
||||
expected []string
|
||||
}{
|
||||
{
|
||||
name: "no object has been removed from the bootstrap configuration",
|
||||
bootstrap: []*flowcontrolv1beta1.FlowSchema{
|
||||
bootstrap: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs2", "pl2", 200).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs3", "pl3", 300).WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.FlowSchema{
|
||||
current: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs2", "pl2", 200).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs3", "pl3", 300).WithAutoUpdateAnnotation("true").Object(),
|
||||
@ -373,8 +373,8 @@ func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "bootstrap is empty, all current objects with the annotation should be candidates",
|
||||
bootstrap: []*flowcontrolv1beta1.FlowSchema{},
|
||||
current: []*flowcontrolv1beta1.FlowSchema{
|
||||
bootstrap: []*flowcontrolv1beta2.FlowSchema{},
|
||||
current: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs2", "pl2", 200).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs3", "pl3", 300).Object(),
|
||||
@ -383,10 +383,10 @@ func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "object(s) have been removed from the bootstrap configuration",
|
||||
bootstrap: []*flowcontrolv1beta1.FlowSchema{
|
||||
bootstrap: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.FlowSchema{
|
||||
current: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs2", "pl2", 200).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs3", "pl3", 300).WithAutoUpdateAnnotation("true").Object(),
|
||||
@ -395,10 +395,10 @@ func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "object(s) without the annotation key are ignored",
|
||||
bootstrap: []*flowcontrolv1beta1.FlowSchema{
|
||||
bootstrap: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.FlowSchema{
|
||||
current: []*flowcontrolv1beta2.FlowSchema{
|
||||
newFlowSchema("fs1", "pl1", 100).WithAutoUpdateAnnotation("true").Object(),
|
||||
newFlowSchema("fs2", "pl2", 200).Object(),
|
||||
newFlowSchema("fs3", "pl3", 300).Object(),
|
||||
@ -409,7 +409,7 @@ func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().FlowSchemas()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().FlowSchemas()
|
||||
for i := range test.current {
|
||||
client.Create(context.TODO(), test.current[i], metav1.CreateOptions{})
|
||||
}
|
||||
@ -427,17 +427,17 @@ func TestGetFlowSchemaRemoveCandidate(t *testing.T) {
|
||||
}
|
||||
|
||||
type fsBuilder struct {
|
||||
object *flowcontrolv1beta1.FlowSchema
|
||||
object *flowcontrolv1beta2.FlowSchema
|
||||
}
|
||||
|
||||
func newFlowSchema(name, plName string, matchingPrecedence int32) *fsBuilder {
|
||||
return &fsBuilder{
|
||||
object: &flowcontrolv1beta1.FlowSchema{
|
||||
object: &flowcontrolv1beta2.FlowSchema{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
Spec: flowcontrolv1beta1.FlowSchemaSpec{
|
||||
PriorityLevelConfiguration: flowcontrolv1beta1.PriorityLevelConfigurationReference{
|
||||
Spec: flowcontrolv1beta2.FlowSchemaSpec{
|
||||
PriorityLevelConfiguration: flowcontrolv1beta2.PriorityLevelConfigurationReference{
|
||||
Name: plName,
|
||||
},
|
||||
MatchingPrecedence: matchingPrecedence,
|
||||
@ -446,7 +446,7 @@ func newFlowSchema(name, plName string, matchingPrecedence int32) *fsBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *fsBuilder) Object() *flowcontrolv1beta1.FlowSchema {
|
||||
func (b *fsBuilder) Object() *flowcontrolv1beta2.FlowSchema {
|
||||
return b.object
|
||||
}
|
||||
|
||||
@ -465,5 +465,5 @@ func setAnnotation(accessor metav1.Object, value string) {
|
||||
accessor.SetAnnotations(map[string]string{})
|
||||
}
|
||||
|
||||
accessor.GetAnnotations()[flowcontrolv1beta1.AutoUpdateAnnotationKey] = value
|
||||
accessor.GetAnnotations()[flowcontrolv1beta2.AutoUpdateAnnotationKey] = value
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolapisv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
flowcontrolapisv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -36,7 +36,7 @@ var (
|
||||
|
||||
// PriorityLevelEnsurer ensures the specified bootstrap configuration objects
|
||||
type PriorityLevelEnsurer interface {
|
||||
Ensure([]*flowcontrolv1beta1.PriorityLevelConfiguration) error
|
||||
Ensure([]*flowcontrolv1beta2.PriorityLevelConfiguration) error
|
||||
}
|
||||
|
||||
// PriorityLevelRemover removes the specified bootstrap configuration objects
|
||||
@ -82,7 +82,7 @@ func NewPriorityLevelRemover(client flowcontrolclient.PriorityLevelConfiguration
|
||||
// names that are candidates for removal from the cluster.
|
||||
// bootstrap: a set of hard coded PriorityLevelConfiguration configuration
|
||||
// objects kube-apiserver maintains in-memory.
|
||||
func GetPriorityLevelRemoveCandidate(client flowcontrolclient.PriorityLevelConfigurationInterface, bootstrap []*flowcontrolv1beta1.PriorityLevelConfiguration) ([]string, error) {
|
||||
func GetPriorityLevelRemoveCandidate(client flowcontrolclient.PriorityLevelConfigurationInterface, bootstrap []*flowcontrolv1beta2.PriorityLevelConfiguration) ([]string, error) {
|
||||
// TODO(101667): Use a lister here to avoid periodic LIST calls
|
||||
plList, err := client.List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
@ -107,7 +107,7 @@ type plEnsurer struct {
|
||||
wrapper configurationWrapper
|
||||
}
|
||||
|
||||
func (e *plEnsurer) Ensure(priorityLevels []*flowcontrolv1beta1.PriorityLevelConfiguration) error {
|
||||
func (e *plEnsurer) Ensure(priorityLevels []*flowcontrolv1beta2.PriorityLevelConfiguration) error {
|
||||
for _, priorityLevel := range priorityLevels {
|
||||
if err := ensureConfiguration(e.wrapper, e.strategy, priorityLevel); err != nil {
|
||||
return err
|
||||
@ -138,7 +138,7 @@ func (fs *priorityLevelConfigurationWrapper) TypeName() string {
|
||||
}
|
||||
|
||||
func (fs *priorityLevelConfigurationWrapper) Create(object runtime.Object) (runtime.Object, error) {
|
||||
plObject, ok := object.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
plObject, ok := object.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return nil, errObjectNotPriorityLevel
|
||||
}
|
||||
@ -147,7 +147,7 @@ func (fs *priorityLevelConfigurationWrapper) Create(object runtime.Object) (runt
|
||||
}
|
||||
|
||||
func (fs *priorityLevelConfigurationWrapper) Update(object runtime.Object) (runtime.Object, error) {
|
||||
fsObject, ok := object.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
fsObject, ok := object.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return nil, errObjectNotPriorityLevel
|
||||
}
|
||||
@ -164,11 +164,11 @@ func (fs *priorityLevelConfigurationWrapper) Delete(name string) error {
|
||||
}
|
||||
|
||||
func (fs *priorityLevelConfigurationWrapper) CopySpec(bootstrap, current runtime.Object) error {
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return errObjectNotPriorityLevel
|
||||
}
|
||||
currentFS, ok := current.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
currentFS, ok := current.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return errObjectNotPriorityLevel
|
||||
}
|
||||
@ -179,11 +179,11 @@ func (fs *priorityLevelConfigurationWrapper) CopySpec(bootstrap, current runtime
|
||||
}
|
||||
|
||||
func (fs *priorityLevelConfigurationWrapper) HasSpecChanged(bootstrap, current runtime.Object) (bool, error) {
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
bootstrapFS, ok := bootstrap.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return false, errObjectNotPriorityLevel
|
||||
}
|
||||
currentFS, ok := current.(*flowcontrolv1beta1.PriorityLevelConfiguration)
|
||||
currentFS, ok := current.(*flowcontrolv1beta2.PriorityLevelConfiguration)
|
||||
if !ok {
|
||||
return false, errObjectNotPriorityLevel
|
||||
}
|
||||
@ -191,8 +191,8 @@ func (fs *priorityLevelConfigurationWrapper) HasSpecChanged(bootstrap, current r
|
||||
return priorityLevelSpecChanged(bootstrapFS, currentFS), nil
|
||||
}
|
||||
|
||||
func priorityLevelSpecChanged(expected, actual *flowcontrolv1beta1.PriorityLevelConfiguration) bool {
|
||||
func priorityLevelSpecChanged(expected, actual *flowcontrolv1beta2.PriorityLevelConfiguration) bool {
|
||||
copiedExpectedPriorityLevel := expected.DeepCopy()
|
||||
flowcontrolapisv1beta1.SetObjectDefaults_PriorityLevelConfiguration(copiedExpectedPriorityLevel)
|
||||
flowcontrolapisv1beta2.SetObjectDefaults_PriorityLevelConfiguration(copiedExpectedPriorityLevel)
|
||||
return !equality.Semantic.DeepEqual(copiedExpectedPriorityLevel.Spec, actual.Spec)
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolapisv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
flowcontrolapisv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -37,9 +37,9 @@ func TestEnsurePriorityLevel(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
strategy func(flowcontrolclient.PriorityLevelConfigurationInterface) PriorityLevelEnsurer
|
||||
current *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
bootstrap *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
expected *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
current *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
bootstrap *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
expected *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
}{
|
||||
// for suggested configurations
|
||||
{
|
||||
@ -102,14 +102,14 @@ func TestEnsurePriorityLevel(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().PriorityLevelConfigurations()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().PriorityLevelConfigurations()
|
||||
if test.current != nil {
|
||||
client.Create(context.TODO(), test.current, metav1.CreateOptions{})
|
||||
}
|
||||
|
||||
ensurer := test.strategy(client)
|
||||
|
||||
err := ensurer.Ensure([]*flowcontrolv1beta1.PriorityLevelConfiguration{test.bootstrap})
|
||||
err := ensurer.Ensure([]*flowcontrolv1beta2.PriorityLevelConfiguration{test.bootstrap})
|
||||
if err != nil {
|
||||
t.Fatalf("Expected no error, but got: %v", err)
|
||||
}
|
||||
@ -134,9 +134,9 @@ func TestEnsurePriorityLevel(t *testing.T) {
|
||||
func TestSuggestedPLEnsureStrategy_ShouldUpdate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
bootstrap *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
newObjectExpected *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
current *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
bootstrap *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
newObjectExpected *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
}{
|
||||
{
|
||||
name: "auto update is enabled, first generation, spec does not match - spec update expected",
|
||||
@ -241,39 +241,39 @@ func TestSuggestedPLEnsureStrategy_ShouldUpdate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPriorityLevelSpecChanged(t *testing.T) {
|
||||
pl1 := &flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta1.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta1.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta1.LimitedPriorityLevelConfiguration{
|
||||
LimitResponse: flowcontrolv1beta1.LimitResponse{
|
||||
Type: flowcontrolv1beta1.LimitResponseTypeReject,
|
||||
pl1 := &flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta2.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta2.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta2.LimitedPriorityLevelConfiguration{
|
||||
LimitResponse: flowcontrolv1beta2.LimitResponse{
|
||||
Type: flowcontrolv1beta2.LimitResponseTypeReject,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
pl2 := &flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta1.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta1.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta1.LimitedPriorityLevelConfiguration{
|
||||
pl2 := &flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta2.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta2.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta2.LimitedPriorityLevelConfiguration{
|
||||
AssuredConcurrencyShares: 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
pl1Defaulted := &flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta1.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta1.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta1.LimitedPriorityLevelConfiguration{
|
||||
AssuredConcurrencyShares: flowcontrolapisv1beta1.PriorityLevelConfigurationDefaultAssuredConcurrencyShares,
|
||||
LimitResponse: flowcontrolv1beta1.LimitResponse{
|
||||
Type: flowcontrolv1beta1.LimitResponseTypeReject,
|
||||
pl1Defaulted := &flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
Spec: flowcontrolv1beta2.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrolv1beta2.PriorityLevelEnablementLimited,
|
||||
Limited: &flowcontrolv1beta2.LimitedPriorityLevelConfiguration{
|
||||
AssuredConcurrencyShares: flowcontrolapisv1beta2.PriorityLevelConfigurationDefaultAssuredConcurrencyShares,
|
||||
LimitResponse: flowcontrolv1beta2.LimitResponse{
|
||||
Type: flowcontrolv1beta2.LimitResponseTypeReject,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
testCases := []struct {
|
||||
name string
|
||||
expected *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
actual *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
expected *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
actual *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
specChanged bool
|
||||
}{
|
||||
{
|
||||
@ -306,7 +306,7 @@ func TestPriorityLevelSpecChanged(t *testing.T) {
|
||||
func TestRemovePriorityLevelConfiguration(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
current *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
bootstrapName string
|
||||
removeExpected bool
|
||||
}{
|
||||
@ -337,7 +337,7 @@ func TestRemovePriorityLevelConfiguration(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().PriorityLevelConfigurations()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().PriorityLevelConfigurations()
|
||||
if test.current != nil {
|
||||
client.Create(context.TODO(), test.current, metav1.CreateOptions{})
|
||||
}
|
||||
@ -369,18 +369,18 @@ func TestRemovePriorityLevelConfiguration(t *testing.T) {
|
||||
func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
current []*flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
bootstrap []*flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
current []*flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
bootstrap []*flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
expected []string
|
||||
}{
|
||||
{
|
||||
name: "no object has been removed from the bootstrap configuration",
|
||||
bootstrap: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
bootstrap: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl2").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl3").WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
current: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl2").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl3").WithAutoUpdateAnnotation("true").Object(),
|
||||
@ -389,8 +389,8 @@ func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "bootstrap is empty, all current objects with the annotation should be candidates",
|
||||
bootstrap: []*flowcontrolv1beta1.PriorityLevelConfiguration{},
|
||||
current: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
bootstrap: []*flowcontrolv1beta2.PriorityLevelConfiguration{},
|
||||
current: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl2").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl3").Object(),
|
||||
@ -399,10 +399,10 @@ func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "object(s) have been removed from the bootstrap configuration",
|
||||
bootstrap: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
bootstrap: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
current: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl2").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl3").WithAutoUpdateAnnotation("true").Object(),
|
||||
@ -411,10 +411,10 @@ func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "object(s) without the annotation key are ignored",
|
||||
bootstrap: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
bootstrap: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
},
|
||||
current: []*flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
current: []*flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
newPLConfiguration("pl1").WithAutoUpdateAnnotation("true").Object(),
|
||||
newPLConfiguration("pl2").Object(),
|
||||
newPLConfiguration("pl3").Object(),
|
||||
@ -425,7 +425,7 @@ func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta1().PriorityLevelConfigurations()
|
||||
client := fake.NewSimpleClientset().FlowcontrolV1beta2().PriorityLevelConfigurations()
|
||||
for i := range test.current {
|
||||
client.Create(context.TODO(), test.current[i], metav1.CreateOptions{})
|
||||
}
|
||||
@ -443,12 +443,12 @@ func TestGetPriorityLevelRemoveCandidate(t *testing.T) {
|
||||
}
|
||||
|
||||
type plBuilder struct {
|
||||
object *flowcontrolv1beta1.PriorityLevelConfiguration
|
||||
object *flowcontrolv1beta2.PriorityLevelConfiguration
|
||||
}
|
||||
|
||||
func newPLConfiguration(name string) *plBuilder {
|
||||
return &plBuilder{
|
||||
object: &flowcontrolv1beta1.PriorityLevelConfiguration{
|
||||
object: &flowcontrolv1beta2.PriorityLevelConfiguration{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
@ -456,7 +456,7 @@ func newPLConfiguration(name string) *plBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *plBuilder) Object() *flowcontrolv1beta1.PriorityLevelConfiguration {
|
||||
func (b *plBuilder) Object() *flowcontrolv1beta2.PriorityLevelConfiguration {
|
||||
return b.object
|
||||
}
|
||||
|
||||
@ -471,11 +471,11 @@ func (b *plBuilder) WithAutoUpdateAnnotation(value string) *plBuilder {
|
||||
}
|
||||
|
||||
func (b *plBuilder) WithLimited(assuredConcurrencyShares int32) *plBuilder {
|
||||
b.object.Spec.Type = flowcontrolv1beta1.PriorityLevelEnablementLimited
|
||||
b.object.Spec.Limited = &flowcontrolv1beta1.LimitedPriorityLevelConfiguration{
|
||||
b.object.Spec.Type = flowcontrolv1beta2.PriorityLevelEnablementLimited
|
||||
b.object.Spec.Limited = &flowcontrolv1beta2.LimitedPriorityLevelConfiguration{
|
||||
AssuredConcurrencyShares: assuredConcurrencyShares,
|
||||
LimitResponse: flowcontrolv1beta1.LimitResponse{
|
||||
Type: flowcontrolv1beta1.LimitResponseTypeReject,
|
||||
LimitResponse: flowcontrolv1beta2.LimitResponse{
|
||||
Type: flowcontrolv1beta2.LimitResponseTypeReject,
|
||||
},
|
||||
}
|
||||
return b
|
||||
@ -488,8 +488,8 @@ func (b *plBuilder) WithQueuing(queues, handSize, queueLengthLimit int32) *plBui
|
||||
return b
|
||||
}
|
||||
|
||||
limited.LimitResponse.Type = flowcontrolv1beta1.LimitResponseTypeQueue
|
||||
limited.LimitResponse.Queuing = &flowcontrolv1beta1.QueuingConfiguration{
|
||||
limited.LimitResponse.Type = flowcontrolv1beta2.LimitResponseTypeQueue
|
||||
limited.LimitResponse.Queuing = &flowcontrolv1beta2.QueuingConfiguration{
|
||||
Queues: queues,
|
||||
HandSize: handSize,
|
||||
QueueLengthLimit: queueLengthLimit,
|
||||
|
@ -53,6 +53,9 @@ func (flowSchemaStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.S
|
||||
"flowcontrol.apiserver.k8s.io/v1beta1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
}
|
||||
|
||||
return fields
|
||||
@ -129,6 +132,10 @@ func (flowSchemaStatusStrategy) GetResetFields() map[fieldpath.APIVersion]*field
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
}
|
||||
|
||||
return fields
|
||||
|
@ -53,6 +53,9 @@ func (priorityLevelConfigurationStrategy) GetResetFields() map[fieldpath.APIVers
|
||||
"flowcontrol.apiserver.k8s.io/v1beta1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
}
|
||||
|
||||
return fields
|
||||
@ -129,6 +132,10 @@ func (priorityLevelConfigurationStatusStrategy) GetResetFields() map[fieldpath.A
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
),
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
),
|
||||
}
|
||||
|
||||
return fields
|
||||
|
@ -27,12 +27,13 @@ import (
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||
serverstorage "k8s.io/apiserver/pkg/server/storage"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
"k8s.io/kubernetes/pkg/apis/flowcontrol"
|
||||
flowcontrolapisv1alpha1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1alpha1"
|
||||
flowcontrolapisv1beta1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1"
|
||||
flowcontrolapisv1beta2 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2"
|
||||
"k8s.io/kubernetes/pkg/registry/flowcontrol/ensurer"
|
||||
flowschemastore "k8s.io/kubernetes/pkg/registry/flowcontrol/flowschema/storage"
|
||||
prioritylevelconfigurationstore "k8s.io/kubernetes/pkg/registry/flowcontrol/prioritylevelconfiguration/storage"
|
||||
@ -66,6 +67,14 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
|
||||
apiGroupInfo.VersionedResourcesStorageMap[flowcontrolapisv1beta1.SchemeGroupVersion.Version] = flowControlStorage
|
||||
}
|
||||
|
||||
if apiResourceConfigSource.VersionEnabled(flowcontrolapisv1beta2.SchemeGroupVersion) {
|
||||
flowControlStorage, err := p.storage(apiResourceConfigSource, restOptionsGetter)
|
||||
if err != nil {
|
||||
return genericapiserver.APIGroupInfo{}, false, err
|
||||
}
|
||||
apiGroupInfo.VersionedResourcesStorageMap[flowcontrolapisv1beta2.SchemeGroupVersion.Version] = flowControlStorage
|
||||
}
|
||||
|
||||
return apiGroupInfo, true, nil
|
||||
}
|
||||
|
||||
@ -144,7 +153,7 @@ func ensureAPFBootstrapConfiguration(hookContext genericapiserver.PostStartHookC
|
||||
return nil
|
||||
}
|
||||
|
||||
func ensure(clientset flowcontrolclient.FlowcontrolV1beta1Interface) error {
|
||||
func ensure(clientset flowcontrolclient.FlowcontrolV1beta2Interface) error {
|
||||
if err := ensureSuggestedConfiguration(clientset); err != nil {
|
||||
// We should not attempt creation of mandatory objects if ensuring the suggested
|
||||
// configuration resulted in an error.
|
||||
@ -163,7 +172,7 @@ func ensure(clientset flowcontrolclient.FlowcontrolV1beta1Interface) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ensureSuggestedConfiguration(clientset flowcontrolclient.FlowcontrolV1beta1Interface) error {
|
||||
func ensureSuggestedConfiguration(clientset flowcontrolclient.FlowcontrolV1beta2Interface) error {
|
||||
fsEnsurer := ensurer.NewSuggestedFlowSchemaEnsurer(clientset.FlowSchemas())
|
||||
if err := fsEnsurer.Ensure(flowcontrolbootstrap.SuggestedFlowSchemas); err != nil {
|
||||
return err
|
||||
@ -173,7 +182,7 @@ func ensureSuggestedConfiguration(clientset flowcontrolclient.FlowcontrolV1beta1
|
||||
return plEnsurer.Ensure(flowcontrolbootstrap.SuggestedPriorityLevelConfigurations)
|
||||
}
|
||||
|
||||
func ensureMandatoryConfiguration(clientset flowcontrolclient.FlowcontrolV1beta1Interface) error {
|
||||
func ensureMandatoryConfiguration(clientset flowcontrolclient.FlowcontrolV1beta2Interface) error {
|
||||
fsEnsurer := ensurer.NewMandatoryFlowSchemaEnsurer(clientset.FlowSchemas())
|
||||
if err := fsEnsurer.Ensure(flowcontrolbootstrap.MandatoryFlowSchemas); err != nil {
|
||||
return err
|
||||
@ -183,7 +192,7 @@ func ensureMandatoryConfiguration(clientset flowcontrolclient.FlowcontrolV1beta1
|
||||
return plEnsurer.Ensure(flowcontrolbootstrap.MandatoryPriorityLevelConfigurations)
|
||||
}
|
||||
|
||||
func removeConfiguration(clientset flowcontrolclient.FlowcontrolV1beta1Interface) error {
|
||||
func removeConfiguration(clientset flowcontrolclient.FlowcontrolV1beta2Interface) error {
|
||||
if err := removeFlowSchema(clientset.FlowSchemas()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
25
staging/src/k8s.io/api/flowcontrol/v1beta2/doc.go
Normal file
25
staging/src/k8s.io/api/flowcontrol/v1beta2/doc.go
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:protobuf-gen=package
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:prerelease-lifecycle-gen=true
|
||||
|
||||
// +groupName=flowcontrol.apiserver.k8s.io
|
||||
|
||||
// Package v1beta2 holds api types of version v1alpha1 for group "flowcontrol.apiserver.k8s.io".
|
||||
package v1beta2 // import "k8s.io/api/flowcontrol/v1beta2"
|
5367
staging/src/k8s.io/api/flowcontrol/v1beta2/generated.pb.go
generated
Normal file
5367
staging/src/k8s.io/api/flowcontrol/v1beta2/generated.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
438
staging/src/k8s.io/api/flowcontrol/v1beta2/generated.proto
Normal file
438
staging/src/k8s.io/api/flowcontrol/v1beta2/generated.proto
Normal file
@ -0,0 +1,438 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package k8s.io.api.flowcontrol.v1beta2;
|
||||
|
||||
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
||||
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
||||
|
||||
// Package-wide variables from generator "generated".
|
||||
option go_package = "v1beta2";
|
||||
|
||||
// FlowDistinguisherMethod specifies the method of a flow distinguisher.
|
||||
message FlowDistinguisherMethod {
|
||||
// `type` is the type of flow distinguisher method
|
||||
// The supported types are "ByUser" and "ByNamespace".
|
||||
// Required.
|
||||
optional string type = 1;
|
||||
}
|
||||
|
||||
// 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".
|
||||
message FlowSchema {
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
||||
|
||||
// `spec` is the specification of the desired behavior of a FlowSchema.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
optional FlowSchemaSpec spec = 2;
|
||||
|
||||
// `status` is the current status of a FlowSchema.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
optional FlowSchemaStatus status = 3;
|
||||
}
|
||||
|
||||
// FlowSchemaCondition describes conditions for a FlowSchema.
|
||||
message FlowSchemaCondition {
|
||||
// `type` is the type of the condition.
|
||||
// Required.
|
||||
optional string type = 1;
|
||||
|
||||
// `status` is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
// Required.
|
||||
optional string status = 2;
|
||||
|
||||
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
|
||||
|
||||
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
|
||||
optional string reason = 4;
|
||||
|
||||
// `message` is a human-readable message indicating details about last transition.
|
||||
optional string message = 5;
|
||||
}
|
||||
|
||||
// FlowSchemaList is a list of FlowSchema objects.
|
||||
message FlowSchemaList {
|
||||
// `metadata` is the standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
|
||||
|
||||
// `items` is a list of FlowSchemas.
|
||||
repeated FlowSchema items = 2;
|
||||
}
|
||||
|
||||
// FlowSchemaSpec describes how the FlowSchema's specification looks like.
|
||||
message FlowSchemaSpec {
|
||||
// `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot
|
||||
// be resolved, the FlowSchema will be ignored and marked as invalid in its status.
|
||||
// Required.
|
||||
optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1;
|
||||
|
||||
// `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen
|
||||
// FlowSchema is among those with the numerically lowest (which we take to be logically highest)
|
||||
// MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000].
|
||||
// Note that if the precedence is not specified, it will be set to 1000 as default.
|
||||
// +optional
|
||||
optional int32 matchingPrecedence = 2;
|
||||
|
||||
// `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema.
|
||||
// `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
|
||||
// +optional
|
||||
optional FlowDistinguisherMethod distinguisherMethod = 3;
|
||||
|
||||
// `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if
|
||||
// at least one member of rules matches the request.
|
||||
// if it is an empty slice, there will be no requests matching the FlowSchema.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
repeated PolicyRulesWithSubjects rules = 4;
|
||||
}
|
||||
|
||||
// FlowSchemaStatus represents the current state of a FlowSchema.
|
||||
message FlowSchemaStatus {
|
||||
// `conditions` is a list of the current states of FlowSchema.
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
repeated FlowSchemaCondition conditions = 1;
|
||||
}
|
||||
|
||||
// GroupSubject holds detailed information for group-kind subject.
|
||||
message GroupSubject {
|
||||
// name is the user group that matches, or "*" to match all user groups.
|
||||
// See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some
|
||||
// well-known group names.
|
||||
// Required.
|
||||
optional string name = 1;
|
||||
}
|
||||
|
||||
// LimitResponse defines how to handle requests that can not be executed right now.
|
||||
// +union
|
||||
message LimitResponse {
|
||||
// `type` is "Queue" or "Reject".
|
||||
// "Queue" means that requests that can not be executed upon arrival
|
||||
// are held in a queue until they can be executed or a queuing limit
|
||||
// is reached.
|
||||
// "Reject" means that requests that can not be executed upon arrival
|
||||
// are rejected.
|
||||
// Required.
|
||||
// +unionDiscriminator
|
||||
optional string type = 1;
|
||||
|
||||
// `queuing` holds the configuration parameters for queuing.
|
||||
// This field may be non-empty only if `type` is `"Queue"`.
|
||||
// +optional
|
||||
optional QueuingConfiguration queuing = 2;
|
||||
}
|
||||
|
||||
// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits.
|
||||
// It addresses two issues:
|
||||
// * How are requests for this priority level limited?
|
||||
// * What should be done with requests that exceed the limit?
|
||||
message LimitedPriorityLevelConfiguration {
|
||||
// `assuredConcurrencyShares` (ACS) configures the execution
|
||||
// limit, which is a limit on the number of requests of this
|
||||
// priority level that may be exeucting at a given time. ACS must
|
||||
// be a positive number. The server's concurrency limit (SCL) is
|
||||
// divided among the concurrency-controlled priority levels in
|
||||
// proportion to their assured concurrency shares. This produces
|
||||
// the assured concurrency value (ACV) --- the number of requests
|
||||
// that may be executing at a time --- for each such priority
|
||||
// level:
|
||||
//
|
||||
// ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
|
||||
//
|
||||
// bigger numbers of ACS mean more reserved concurrent requests (at the
|
||||
// expense of every other PL).
|
||||
// This field has a default value of 30.
|
||||
// +optional
|
||||
optional int32 assuredConcurrencyShares = 1;
|
||||
|
||||
// `limitResponse` indicates what to do with requests that can not be executed right now
|
||||
optional LimitResponse limitResponse = 2;
|
||||
}
|
||||
|
||||
// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the
|
||||
// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member
|
||||
// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.
|
||||
message NonResourcePolicyRule {
|
||||
// `verbs` is a list of matching verbs and may not be empty.
|
||||
// "*" matches all verbs. If it is present, it must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
repeated string verbs = 1;
|
||||
|
||||
// `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty.
|
||||
// For example:
|
||||
// - "/healthz" is legal
|
||||
// - "/hea*" is illegal
|
||||
// - "/hea" is legal but matches nothing
|
||||
// - "/hea/*" also matches nothing
|
||||
// - "/healthz/*" matches all per-component health checks.
|
||||
// "*" matches all non-resource urls. if it is present, it must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
repeated string nonResourceURLs = 6;
|
||||
}
|
||||
|
||||
// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject
|
||||
// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches
|
||||
// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member
|
||||
// of resourceRules or nonResourceRules matches the request.
|
||||
message PolicyRulesWithSubjects {
|
||||
// subjects is the list of normal user, serviceaccount, or group that this rule cares about.
|
||||
// There must be at least one member in this slice.
|
||||
// A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request.
|
||||
// +listType=atomic
|
||||
// Required.
|
||||
repeated Subject subjects = 1;
|
||||
|
||||
// `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the
|
||||
// target resource.
|
||||
// At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
repeated ResourcePolicyRule resourceRules = 2;
|
||||
|
||||
// `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb
|
||||
// and the target non-resource URL.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
repeated NonResourcePolicyRule nonResourceRules = 3;
|
||||
}
|
||||
|
||||
// PriorityLevelConfiguration represents the configuration of a priority level.
|
||||
message PriorityLevelConfiguration {
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
||||
|
||||
// `spec` is the specification of the desired behavior of a "request-priority".
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
optional PriorityLevelConfigurationSpec spec = 2;
|
||||
|
||||
// `status` is the current status of a "request-priority".
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
optional PriorityLevelConfigurationStatus status = 3;
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationCondition defines the condition of priority level.
|
||||
message PriorityLevelConfigurationCondition {
|
||||
// `type` is the type of the condition.
|
||||
// Required.
|
||||
optional string type = 1;
|
||||
|
||||
// `status` is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
// Required.
|
||||
optional string status = 2;
|
||||
|
||||
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
|
||||
|
||||
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
|
||||
optional string reason = 4;
|
||||
|
||||
// `message` is a human-readable message indicating details about last transition.
|
||||
optional string message = 5;
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
|
||||
message PriorityLevelConfigurationList {
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
|
||||
|
||||
// `items` is a list of request-priorities.
|
||||
repeated PriorityLevelConfiguration items = 2;
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used.
|
||||
message PriorityLevelConfigurationReference {
|
||||
// `name` is the name of the priority level configuration being referenced
|
||||
// Required.
|
||||
optional string name = 1;
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationSpec specifies the configuration of a priority level.
|
||||
// +union
|
||||
message PriorityLevelConfigurationSpec {
|
||||
// `type` indicates whether this priority level is subject to
|
||||
// limitation on request execution. A value of `"Exempt"` means
|
||||
// that requests of this priority level are not subject to a limit
|
||||
// (and thus are never queued) and do not detract from the
|
||||
// capacity made available to other priority levels. A value of
|
||||
// `"Limited"` means that (a) requests of this priority level
|
||||
// _are_ subject to limits and (b) some of the server's limited
|
||||
// capacity is made available exclusively to this priority level.
|
||||
// Required.
|
||||
// +unionDiscriminator
|
||||
optional string type = 1;
|
||||
|
||||
// `limited` specifies how requests are handled for a Limited priority level.
|
||||
// This field must be non-empty if and only if `type` is `"Limited"`.
|
||||
// +optional
|
||||
optional LimitedPriorityLevelConfiguration limited = 2;
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationStatus represents the current state of a "request-priority".
|
||||
message PriorityLevelConfigurationStatus {
|
||||
// `conditions` is the current state of "request-priority".
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
repeated PriorityLevelConfigurationCondition conditions = 1;
|
||||
}
|
||||
|
||||
// QueuingConfiguration holds the configuration parameters for queuing
|
||||
message QueuingConfiguration {
|
||||
// `queues` is the number of queues for this priority level. The
|
||||
// queues exist independently at each apiserver. The value must be
|
||||
// positive. Setting it to 1 effectively precludes
|
||||
// shufflesharding and thus makes the distinguisher method of
|
||||
// associated flow schemas irrelevant. This field has a default
|
||||
// value of 64.
|
||||
// +optional
|
||||
optional int32 queues = 1;
|
||||
|
||||
// `handSize` is a small positive number that configures the
|
||||
// shuffle sharding of requests into queues. When enqueuing a request
|
||||
// at this priority level the request's flow identifier (a string
|
||||
// pair) is hashed and the hash value is used to shuffle the list
|
||||
// of queues and deal a hand of the size specified here. The
|
||||
// request is put into one of the shortest queues in that hand.
|
||||
// `handSize` must be no larger than `queues`, and should be
|
||||
// significantly smaller (so that a few heavy flows do not
|
||||
// saturate most of the queues). See the user-facing
|
||||
// documentation for more extensive guidance on setting this
|
||||
// field. This field has a default value of 8.
|
||||
// +optional
|
||||
optional int32 handSize = 2;
|
||||
|
||||
// `queueLengthLimit` is the maximum number of requests allowed to
|
||||
// be waiting in a given queue of this priority level at a time;
|
||||
// excess requests are rejected. This value must be positive. If
|
||||
// not specified, it will be defaulted to 50.
|
||||
// +optional
|
||||
optional int32 queueLengthLimit = 3;
|
||||
}
|
||||
|
||||
// ResourcePolicyRule is a predicate that matches some resource
|
||||
// requests, testing the request's verb and the target resource. A
|
||||
// ResourcePolicyRule matches a resource request if and only if: (a)
|
||||
// at least one member of verbs matches the request, (b) at least one
|
||||
// member of apiGroups matches the request, (c) at least one member of
|
||||
// resources matches the request, and (d) least one member of
|
||||
// namespaces matches the request.
|
||||
message ResourcePolicyRule {
|
||||
// `verbs` is a list of matching verbs and may not be empty.
|
||||
// "*" matches all verbs and, if present, must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
repeated string verbs = 1;
|
||||
|
||||
// `apiGroups` is a list of matching API groups and may not be empty.
|
||||
// "*" matches all API groups and, if present, must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
repeated string apiGroups = 2;
|
||||
|
||||
// `resources` is a list of matching resources (i.e., lowercase
|
||||
// and plural) with, if desired, subresource. For example, [
|
||||
// "services", "nodes/status" ]. This list may not be empty.
|
||||
// "*" matches all resources and, if present, must be the only entry.
|
||||
// Required.
|
||||
// +listType=set
|
||||
repeated string resources = 3;
|
||||
|
||||
// `clusterScope` indicates whether to match requests that do not
|
||||
// specify a namespace (which happens either because the resource
|
||||
// is not namespaced or the request targets all namespaces).
|
||||
// If this field is omitted or false then the `namespaces` field
|
||||
// must contain a non-empty list.
|
||||
// +optional
|
||||
optional bool clusterScope = 4;
|
||||
|
||||
// `namespaces` is a list of target namespaces that restricts
|
||||
// matches. A request that specifies a target namespace matches
|
||||
// only if either (a) this list contains that target namespace or
|
||||
// (b) this list contains "*". Note that "*" matches any
|
||||
// specified namespace but does not match a request that _does
|
||||
// not specify_ a namespace (see the `clusterScope` field for
|
||||
// that).
|
||||
// This list may be empty, but only if `clusterScope` is true.
|
||||
// +optional
|
||||
// +listType=set
|
||||
repeated string namespaces = 5;
|
||||
}
|
||||
|
||||
// ServiceAccountSubject holds detailed information for service-account-kind subject.
|
||||
message ServiceAccountSubject {
|
||||
// `namespace` is the namespace of matching ServiceAccount objects.
|
||||
// Required.
|
||||
optional string namespace = 1;
|
||||
|
||||
// `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name.
|
||||
// Required.
|
||||
optional string name = 2;
|
||||
}
|
||||
|
||||
// Subject matches the originator of a request, as identified by the request authentication system. There are three
|
||||
// ways of matching an originator; by user, group, or service account.
|
||||
// +union
|
||||
message Subject {
|
||||
// `kind` indicates which one of the other fields is non-empty.
|
||||
// Required
|
||||
// +unionDiscriminator
|
||||
optional string kind = 1;
|
||||
|
||||
// `user` matches based on username.
|
||||
// +optional
|
||||
optional UserSubject user = 2;
|
||||
|
||||
// `group` matches based on user group name.
|
||||
// +optional
|
||||
optional GroupSubject group = 3;
|
||||
|
||||
// `serviceAccount` matches ServiceAccounts.
|
||||
// +optional
|
||||
optional ServiceAccountSubject serviceAccount = 4;
|
||||
}
|
||||
|
||||
// UserSubject holds detailed information for user-kind subject.
|
||||
message UserSubject {
|
||||
// `name` is the username that matches, or "*" to match all usernames.
|
||||
// Required.
|
||||
optional string name = 1;
|
||||
}
|
||||
|
58
staging/src/k8s.io/api/flowcontrol/v1beta2/register.go
Normal file
58
staging/src/k8s.io/api/flowcontrol/v1beta2/register.go
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2019 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the name of api group
|
||||
const GroupName = "flowcontrol.apiserver.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
// SchemeBuilder installs the api group to a scheme
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
// AddToScheme adds api to a scheme
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to the given scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&FlowSchema{},
|
||||
&FlowSchemaList{},
|
||||
&PriorityLevelConfiguration{},
|
||||
&PriorityLevelConfigurationList{},
|
||||
)
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
577
staging/src/k8s.io/api/flowcontrol/v1beta2/types.go
Normal file
577
staging/src/k8s.io/api/flowcontrol/v1beta2/types.go
Normal file
@ -0,0 +1,577 @@
|
||||
/*
|
||||
Copyright 2019 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// These are valid wildcards.
|
||||
const (
|
||||
APIGroupAll = "*"
|
||||
ResourceAll = "*"
|
||||
VerbAll = "*"
|
||||
NonResourceAll = "*"
|
||||
NameAll = "*"
|
||||
|
||||
NamespaceEvery = "*" // matches every particular namespace
|
||||
)
|
||||
|
||||
// System preset priority level names
|
||||
const (
|
||||
PriorityLevelConfigurationNameExempt = "exempt"
|
||||
PriorityLevelConfigurationNameCatchAll = "catch-all"
|
||||
FlowSchemaNameExempt = "exempt"
|
||||
FlowSchemaNameCatchAll = "catch-all"
|
||||
)
|
||||
|
||||
// Conditions
|
||||
const (
|
||||
FlowSchemaConditionDangling = "Dangling"
|
||||
|
||||
PriorityLevelConfigurationConditionConcurrencyShared = "ConcurrencyShared"
|
||||
)
|
||||
|
||||
// Constants used by api validation.
|
||||
const (
|
||||
FlowSchemaMaxMatchingPrecedence int32 = 10000
|
||||
)
|
||||
|
||||
// Constants for apiserver response headers.
|
||||
const (
|
||||
ResponseHeaderMatchedPriorityLevelConfigurationUID = "X-Kubernetes-PF-PriorityLevel-UID"
|
||||
ResponseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID"
|
||||
)
|
||||
|
||||
const (
|
||||
// AutoUpdateAnnotationKey is the name of an annotation that enables
|
||||
// automatic update of the spec of the bootstrap configuration
|
||||
// object(s), if set to 'true'.
|
||||
//
|
||||
// On a fresh install, all bootstrap configuration objects will have auto
|
||||
// update enabled with the following annotation key:
|
||||
// apf.kubernetes.io/autoupdate-spec: 'true'
|
||||
//
|
||||
// The kube-apiserver periodically checks the bootstrap configuration
|
||||
// objects on the cluster and applies updates if necessary.
|
||||
//
|
||||
// kube-apiserver enforces an 'always auto-update' policy for the
|
||||
// mandatory configuration object(s). This implies:
|
||||
// - the auto-update annotation key is added with a value of 'true'
|
||||
// if it is missing.
|
||||
// - the auto-update annotation key is set to 'true' if its current value
|
||||
// is a boolean false or has an invalid boolean representation
|
||||
// (if the cluster operator sets it to 'false' it will be stomped)
|
||||
// - any changes to the spec made by the cluster operator will be
|
||||
// stomped.
|
||||
//
|
||||
// The kube-apiserver will apply updates on the suggested configuration if:
|
||||
// - the cluster operator has enabled auto-update by setting the annotation
|
||||
// (apf.kubernetes.io/autoupdate-spec: 'true') or
|
||||
// - the annotation key is missing but the generation is 1
|
||||
//
|
||||
// If the suggested configuration object is missing the annotation key,
|
||||
// kube-apiserver will update the annotation appropriately:
|
||||
// - it is set to 'true' if generation of the object is '1' which usually
|
||||
// indicates that the spec of the object has not been changed.
|
||||
// - it is set to 'false' if generation of the object is greater than 1.
|
||||
//
|
||||
// The goal is to enable the kube-apiserver to apply update on suggested
|
||||
// configuration objects installed by previous releases but not overwrite
|
||||
// changes made by the cluster operators.
|
||||
// Note that this distinction is imperfectly detected: in the case where an
|
||||
// operator deletes a suggested configuration object and later creates it
|
||||
// but with a variant spec and then does no updates of the object
|
||||
// (generation is 1), the technique outlined above will incorrectly
|
||||
// determine that the object should be auto-updated.
|
||||
AutoUpdateAnnotationKey = "apf.kubernetes.io/autoupdate-spec"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.23
|
||||
|
||||
// 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".
|
||||
type FlowSchema struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
// `spec` is the specification of the desired behavior of a FlowSchema.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
|
||||
// `status` is the current status of a FlowSchema.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
Status FlowSchemaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.23
|
||||
|
||||
// FlowSchemaList is a list of FlowSchema objects.
|
||||
type FlowSchemaList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// `metadata` is the standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// `items` is a list of FlowSchemas.
|
||||
Items []FlowSchema `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||
}
|
||||
|
||||
// FlowSchemaSpec describes how the FlowSchema's specification looks like.
|
||||
type FlowSchemaSpec struct {
|
||||
// `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot
|
||||
// be resolved, the FlowSchema will be ignored and marked as invalid in its status.
|
||||
// Required.
|
||||
PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"`
|
||||
// `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen
|
||||
// FlowSchema is among those with the numerically lowest (which we take to be logically highest)
|
||||
// MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000].
|
||||
// Note that if the precedence is not specified, it will be set to 1000 as default.
|
||||
// +optional
|
||||
MatchingPrecedence int32 `json:"matchingPrecedence" protobuf:"varint,2,opt,name=matchingPrecedence"`
|
||||
// `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema.
|
||||
// `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
|
||||
// +optional
|
||||
DistinguisherMethod *FlowDistinguisherMethod `json:"distinguisherMethod,omitempty" protobuf:"bytes,3,opt,name=distinguisherMethod"`
|
||||
// `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if
|
||||
// at least one member of rules matches the request.
|
||||
// if it is an empty slice, there will be no requests matching the FlowSchema.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
Rules []PolicyRulesWithSubjects `json:"rules,omitempty" protobuf:"bytes,4,rep,name=rules"`
|
||||
}
|
||||
|
||||
// FlowDistinguisherMethodType is the type of flow distinguisher method
|
||||
type FlowDistinguisherMethodType string
|
||||
|
||||
// These are valid flow-distinguisher methods.
|
||||
const (
|
||||
// FlowDistinguisherMethodByUserType specifies that the flow distinguisher is the username in the request.
|
||||
// This type is used to provide some insulation between users.
|
||||
FlowDistinguisherMethodByUserType FlowDistinguisherMethodType = "ByUser"
|
||||
|
||||
// FlowDistinguisherMethodByNamespaceType specifies that the flow distinguisher is the namespace of the
|
||||
// object that the request acts upon. If the object is not namespaced, or if the request is a non-resource
|
||||
// request, then the distinguisher will be the empty string. An example usage of this type is to provide
|
||||
// some insulation between tenants in a situation where there are multiple tenants and each namespace
|
||||
// is dedicated to a tenant.
|
||||
FlowDistinguisherMethodByNamespaceType FlowDistinguisherMethodType = "ByNamespace"
|
||||
)
|
||||
|
||||
// FlowDistinguisherMethod specifies the method of a flow distinguisher.
|
||||
type FlowDistinguisherMethod struct {
|
||||
// `type` is the type of flow distinguisher method
|
||||
// The supported types are "ByUser" and "ByNamespace".
|
||||
// Required.
|
||||
Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used.
|
||||
type PriorityLevelConfigurationReference struct {
|
||||
// `name` is the name of the priority level configuration being referenced
|
||||
// Required.
|
||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||
}
|
||||
|
||||
// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject
|
||||
// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches
|
||||
// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member
|
||||
// of resourceRules or nonResourceRules matches the request.
|
||||
type PolicyRulesWithSubjects struct {
|
||||
// subjects is the list of normal user, serviceaccount, or group that this rule cares about.
|
||||
// There must be at least one member in this slice.
|
||||
// A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request.
|
||||
// +listType=atomic
|
||||
// Required.
|
||||
Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"`
|
||||
// `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the
|
||||
// target resource.
|
||||
// At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
ResourceRules []ResourcePolicyRule `json:"resourceRules,omitempty" protobuf:"bytes,2,opt,name=resourceRules"`
|
||||
// `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb
|
||||
// and the target non-resource URL.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
NonResourceRules []NonResourcePolicyRule `json:"nonResourceRules,omitempty" protobuf:"bytes,3,opt,name=nonResourceRules"`
|
||||
}
|
||||
|
||||
// Subject matches the originator of a request, as identified by the request authentication system. There are three
|
||||
// ways of matching an originator; by user, group, or service account.
|
||||
// +union
|
||||
type Subject struct {
|
||||
// `kind` indicates which one of the other fields is non-empty.
|
||||
// Required
|
||||
// +unionDiscriminator
|
||||
Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"`
|
||||
// `user` matches based on username.
|
||||
// +optional
|
||||
User *UserSubject `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
|
||||
// `group` matches based on user group name.
|
||||
// +optional
|
||||
Group *GroupSubject `json:"group,omitempty" protobuf:"bytes,3,opt,name=group"`
|
||||
// `serviceAccount` matches ServiceAccounts.
|
||||
// +optional
|
||||
ServiceAccount *ServiceAccountSubject `json:"serviceAccount,omitempty" protobuf:"bytes,4,opt,name=serviceAccount"`
|
||||
}
|
||||
|
||||
// SubjectKind is the kind of subject.
|
||||
type SubjectKind string
|
||||
|
||||
// Supported subject's kinds.
|
||||
const (
|
||||
SubjectKindUser SubjectKind = "User"
|
||||
SubjectKindGroup SubjectKind = "Group"
|
||||
SubjectKindServiceAccount SubjectKind = "ServiceAccount"
|
||||
)
|
||||
|
||||
// UserSubject holds detailed information for user-kind subject.
|
||||
type UserSubject struct {
|
||||
// `name` is the username that matches, or "*" to match all usernames.
|
||||
// Required.
|
||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||
}
|
||||
|
||||
// GroupSubject holds detailed information for group-kind subject.
|
||||
type GroupSubject struct {
|
||||
// name is the user group that matches, or "*" to match all user groups.
|
||||
// See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some
|
||||
// well-known group names.
|
||||
// Required.
|
||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||
}
|
||||
|
||||
// ServiceAccountSubject holds detailed information for service-account-kind subject.
|
||||
type ServiceAccountSubject struct {
|
||||
// `namespace` is the namespace of matching ServiceAccount objects.
|
||||
// Required.
|
||||
Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
|
||||
// `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name.
|
||||
// Required.
|
||||
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
|
||||
}
|
||||
|
||||
// ResourcePolicyRule is a predicate that matches some resource
|
||||
// requests, testing the request's verb and the target resource. A
|
||||
// ResourcePolicyRule matches a resource request if and only if: (a)
|
||||
// at least one member of verbs matches the request, (b) at least one
|
||||
// member of apiGroups matches the request, (c) at least one member of
|
||||
// resources matches the request, and (d) least one member of
|
||||
// namespaces matches the request.
|
||||
type ResourcePolicyRule struct {
|
||||
// `verbs` is a list of matching verbs and may not be empty.
|
||||
// "*" matches all verbs and, if present, must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
|
||||
|
||||
// `apiGroups` is a list of matching API groups and may not be empty.
|
||||
// "*" matches all API groups and, if present, must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"`
|
||||
|
||||
// `resources` is a list of matching resources (i.e., lowercase
|
||||
// and plural) with, if desired, subresource. For example, [
|
||||
// "services", "nodes/status" ]. This list may not be empty.
|
||||
// "*" matches all resources and, if present, must be the only entry.
|
||||
// Required.
|
||||
// +listType=set
|
||||
Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"`
|
||||
|
||||
// `clusterScope` indicates whether to match requests that do not
|
||||
// specify a namespace (which happens either because the resource
|
||||
// is not namespaced or the request targets all namespaces).
|
||||
// If this field is omitted or false then the `namespaces` field
|
||||
// must contain a non-empty list.
|
||||
// +optional
|
||||
ClusterScope bool `json:"clusterScope,omitempty" protobuf:"varint,4,opt,name=clusterScope"`
|
||||
|
||||
// `namespaces` is a list of target namespaces that restricts
|
||||
// matches. A request that specifies a target namespace matches
|
||||
// only if either (a) this list contains that target namespace or
|
||||
// (b) this list contains "*". Note that "*" matches any
|
||||
// specified namespace but does not match a request that _does
|
||||
// not specify_ a namespace (see the `clusterScope` field for
|
||||
// that).
|
||||
// This list may be empty, but only if `clusterScope` is true.
|
||||
// +optional
|
||||
// +listType=set
|
||||
Namespaces []string `json:"namespaces" protobuf:"bytes,5,rep,name=namespaces"`
|
||||
}
|
||||
|
||||
// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the
|
||||
// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member
|
||||
// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.
|
||||
type NonResourcePolicyRule struct {
|
||||
// `verbs` is a list of matching verbs and may not be empty.
|
||||
// "*" matches all verbs. If it is present, it must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
|
||||
// `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty.
|
||||
// For example:
|
||||
// - "/healthz" is legal
|
||||
// - "/hea*" is illegal
|
||||
// - "/hea" is legal but matches nothing
|
||||
// - "/hea/*" also matches nothing
|
||||
// - "/healthz/*" matches all per-component health checks.
|
||||
// "*" matches all non-resource urls. if it is present, it must be the only entry.
|
||||
// +listType=set
|
||||
// Required.
|
||||
NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"`
|
||||
}
|
||||
|
||||
// FlowSchemaStatus represents the current state of a FlowSchema.
|
||||
type FlowSchemaStatus struct {
|
||||
// `conditions` is a list of the current states of FlowSchema.
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
Conditions []FlowSchemaCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
||||
}
|
||||
|
||||
// FlowSchemaCondition describes conditions for a FlowSchema.
|
||||
type FlowSchemaCondition struct {
|
||||
// `type` is the type of the condition.
|
||||
// Required.
|
||||
Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
|
||||
// `status` is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
// Required.
|
||||
Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
|
||||
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
|
||||
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
|
||||
// `message` is a human-readable message indicating details about last transition.
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
|
||||
}
|
||||
|
||||
// FlowSchemaConditionType is a valid value for FlowSchemaStatusCondition.Type
|
||||
type FlowSchemaConditionType string
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.23
|
||||
|
||||
// PriorityLevelConfiguration represents the configuration of a priority level.
|
||||
type PriorityLevelConfiguration struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
// `spec` is the specification of the desired behavior of a "request-priority".
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
|
||||
// `status` is the current status of a "request-priority".
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
Status PriorityLevelConfigurationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.23
|
||||
|
||||
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
|
||||
type PriorityLevelConfigurationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// `metadata` is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
// `items` is a list of request-priorities.
|
||||
Items []PriorityLevelConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationSpec specifies the configuration of a priority level.
|
||||
// +union
|
||||
type PriorityLevelConfigurationSpec struct {
|
||||
// `type` indicates whether this priority level is subject to
|
||||
// limitation on request execution. A value of `"Exempt"` means
|
||||
// that requests of this priority level are not subject to a limit
|
||||
// (and thus are never queued) and do not detract from the
|
||||
// capacity made available to other priority levels. A value of
|
||||
// `"Limited"` means that (a) requests of this priority level
|
||||
// _are_ subject to limits and (b) some of the server's limited
|
||||
// capacity is made available exclusively to this priority level.
|
||||
// Required.
|
||||
// +unionDiscriminator
|
||||
Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"`
|
||||
|
||||
// `limited` specifies how requests are handled for a Limited priority level.
|
||||
// This field must be non-empty if and only if `type` is `"Limited"`.
|
||||
// +optional
|
||||
Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"`
|
||||
}
|
||||
|
||||
// PriorityLevelEnablement indicates whether limits on execution are enabled for the priority level
|
||||
type PriorityLevelEnablement string
|
||||
|
||||
// Supported priority level enablement values.
|
||||
const (
|
||||
// PriorityLevelEnablementExempt means that requests are not subject to limits
|
||||
PriorityLevelEnablementExempt PriorityLevelEnablement = "Exempt"
|
||||
|
||||
// PriorityLevelEnablementLimited means that requests are subject to limits
|
||||
PriorityLevelEnablementLimited PriorityLevelEnablement = "Limited"
|
||||
)
|
||||
|
||||
// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits.
|
||||
// It addresses two issues:
|
||||
// * How are requests for this priority level limited?
|
||||
// * What should be done with requests that exceed the limit?
|
||||
type LimitedPriorityLevelConfiguration struct {
|
||||
// `assuredConcurrencyShares` (ACS) configures the execution
|
||||
// limit, which is a limit on the number of requests of this
|
||||
// priority level that may be exeucting at a given time. ACS must
|
||||
// be a positive number. The server's concurrency limit (SCL) is
|
||||
// divided among the concurrency-controlled priority levels in
|
||||
// proportion to their assured concurrency shares. This produces
|
||||
// the assured concurrency value (ACV) --- the number of requests
|
||||
// that may be executing at a time --- for each such priority
|
||||
// level:
|
||||
//
|
||||
// ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
|
||||
//
|
||||
// bigger numbers of ACS mean more reserved concurrent requests (at the
|
||||
// expense of every other PL).
|
||||
// This field has a default value of 30.
|
||||
// +optional
|
||||
AssuredConcurrencyShares int32 `json:"assuredConcurrencyShares" protobuf:"varint,1,opt,name=assuredConcurrencyShares"`
|
||||
|
||||
// `limitResponse` indicates what to do with requests that can not be executed right now
|
||||
LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"`
|
||||
}
|
||||
|
||||
// LimitResponse defines how to handle requests that can not be executed right now.
|
||||
// +union
|
||||
type LimitResponse struct {
|
||||
// `type` is "Queue" or "Reject".
|
||||
// "Queue" means that requests that can not be executed upon arrival
|
||||
// are held in a queue until they can be executed or a queuing limit
|
||||
// is reached.
|
||||
// "Reject" means that requests that can not be executed upon arrival
|
||||
// are rejected.
|
||||
// Required.
|
||||
// +unionDiscriminator
|
||||
Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"`
|
||||
|
||||
// `queuing` holds the configuration parameters for queuing.
|
||||
// This field may be non-empty only if `type` is `"Queue"`.
|
||||
// +optional
|
||||
Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"`
|
||||
}
|
||||
|
||||
// LimitResponseType identifies how a Limited priority level handles a request that can not be executed right now
|
||||
type LimitResponseType string
|
||||
|
||||
// Supported limit responses.
|
||||
const (
|
||||
// LimitResponseTypeQueue means that requests that can not be executed right now are queued until they can be executed or a queuing limit is hit
|
||||
LimitResponseTypeQueue LimitResponseType = "Queue"
|
||||
|
||||
// LimitResponseTypeReject means that requests that can not be executed right now are rejected
|
||||
LimitResponseTypeReject LimitResponseType = "Reject"
|
||||
)
|
||||
|
||||
// QueuingConfiguration holds the configuration parameters for queuing
|
||||
type QueuingConfiguration struct {
|
||||
// `queues` is the number of queues for this priority level. The
|
||||
// queues exist independently at each apiserver. The value must be
|
||||
// positive. Setting it to 1 effectively precludes
|
||||
// shufflesharding and thus makes the distinguisher method of
|
||||
// associated flow schemas irrelevant. This field has a default
|
||||
// value of 64.
|
||||
// +optional
|
||||
Queues int32 `json:"queues" protobuf:"varint,1,opt,name=queues"`
|
||||
|
||||
// `handSize` is a small positive number that configures the
|
||||
// shuffle sharding of requests into queues. When enqueuing a request
|
||||
// at this priority level the request's flow identifier (a string
|
||||
// pair) is hashed and the hash value is used to shuffle the list
|
||||
// of queues and deal a hand of the size specified here. The
|
||||
// request is put into one of the shortest queues in that hand.
|
||||
// `handSize` must be no larger than `queues`, and should be
|
||||
// significantly smaller (so that a few heavy flows do not
|
||||
// saturate most of the queues). See the user-facing
|
||||
// documentation for more extensive guidance on setting this
|
||||
// field. This field has a default value of 8.
|
||||
// +optional
|
||||
HandSize int32 `json:"handSize" protobuf:"varint,2,opt,name=handSize"`
|
||||
|
||||
// `queueLengthLimit` is the maximum number of requests allowed to
|
||||
// be waiting in a given queue of this priority level at a time;
|
||||
// excess requests are rejected. This value must be positive. If
|
||||
// not specified, it will be defaulted to 50.
|
||||
// +optional
|
||||
QueueLengthLimit int32 `json:"queueLengthLimit" protobuf:"varint,3,opt,name=queueLengthLimit"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationConditionType is a valid value for PriorityLevelConfigurationStatusCondition.Type
|
||||
type PriorityLevelConfigurationConditionType string
|
||||
|
||||
// PriorityLevelConfigurationStatus represents the current state of a "request-priority".
|
||||
type PriorityLevelConfigurationStatus struct {
|
||||
// `conditions` is the current state of "request-priority".
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
Conditions []PriorityLevelConfigurationCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationCondition defines the condition of priority level.
|
||||
type PriorityLevelConfigurationCondition struct {
|
||||
// `type` is the type of the condition.
|
||||
// Required.
|
||||
Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
|
||||
// `status` is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
// Required.
|
||||
Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
|
||||
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
|
||||
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
|
||||
// `message` is a human-readable message indicating details about last transition.
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
|
||||
}
|
||||
|
||||
// ConditionStatus is the status of the condition.
|
||||
type ConditionStatus string
|
||||
|
||||
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
|
||||
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
|
||||
// can't decide if a resource is in the condition or not. In the future, we could add other
|
||||
// intermediate conditions, e.g. ConditionDegraded.
|
||||
const (
|
||||
ConditionTrue ConditionStatus = "True"
|
||||
ConditionFalse ConditionStatus = "False"
|
||||
ConditionUnknown ConditionStatus = "Unknown"
|
||||
)
|
261
staging/src/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go
generated
Normal file
261
staging/src/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go
generated
Normal file
@ -0,0 +1,261 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta2
|
||||
|
||||
// This file contains a collection of methods that can be used from go-restful to
|
||||
// generate Swagger API documentation for its models. Please read this PR for more
|
||||
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
|
||||
//
|
||||
// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
|
||||
// they are on one line! For multiple line or blocks that you want to ignore use ---.
|
||||
// Any context after a --- is ignored.
|
||||
//
|
||||
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
|
||||
var map_FlowDistinguisherMethod = map[string]string{
|
||||
"": "FlowDistinguisherMethod specifies the method of a flow distinguisher.",
|
||||
"type": "`type` is the type of flow distinguisher method The supported types are \"ByUser\" and \"ByNamespace\". Required.",
|
||||
}
|
||||
|
||||
func (FlowDistinguisherMethod) SwaggerDoc() map[string]string {
|
||||
return map_FlowDistinguisherMethod
|
||||
}
|
||||
|
||||
var map_FlowSchema = map[string]string{
|
||||
"": "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\".",
|
||||
"metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"spec": "`spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
|
||||
"status": "`status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
|
||||
}
|
||||
|
||||
func (FlowSchema) SwaggerDoc() map[string]string {
|
||||
return map_FlowSchema
|
||||
}
|
||||
|
||||
var map_FlowSchemaCondition = map[string]string{
|
||||
"": "FlowSchemaCondition describes conditions for a FlowSchema.",
|
||||
"type": "`type` is the type of the condition. Required.",
|
||||
"status": "`status` is the status of the condition. Can be True, False, Unknown. Required.",
|
||||
"lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.",
|
||||
"reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.",
|
||||
"message": "`message` is a human-readable message indicating details about last transition.",
|
||||
}
|
||||
|
||||
func (FlowSchemaCondition) SwaggerDoc() map[string]string {
|
||||
return map_FlowSchemaCondition
|
||||
}
|
||||
|
||||
var map_FlowSchemaList = map[string]string{
|
||||
"": "FlowSchemaList is a list of FlowSchema objects.",
|
||||
"metadata": "`metadata` is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"items": "`items` is a list of FlowSchemas.",
|
||||
}
|
||||
|
||||
func (FlowSchemaList) SwaggerDoc() map[string]string {
|
||||
return map_FlowSchemaList
|
||||
}
|
||||
|
||||
var map_FlowSchemaSpec = map[string]string{
|
||||
"": "FlowSchemaSpec describes how the FlowSchema's specification looks like.",
|
||||
"priorityLevelConfiguration": "`priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.",
|
||||
"matchingPrecedence": "`matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as default.",
|
||||
"distinguisherMethod": "`distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.",
|
||||
"rules": "`rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.",
|
||||
}
|
||||
|
||||
func (FlowSchemaSpec) SwaggerDoc() map[string]string {
|
||||
return map_FlowSchemaSpec
|
||||
}
|
||||
|
||||
var map_FlowSchemaStatus = map[string]string{
|
||||
"": "FlowSchemaStatus represents the current state of a FlowSchema.",
|
||||
"conditions": "`conditions` is a list of the current states of FlowSchema.",
|
||||
}
|
||||
|
||||
func (FlowSchemaStatus) SwaggerDoc() map[string]string {
|
||||
return map_FlowSchemaStatus
|
||||
}
|
||||
|
||||
var map_GroupSubject = map[string]string{
|
||||
"": "GroupSubject holds detailed information for group-kind subject.",
|
||||
"name": "name is the user group that matches, or \"*\" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.",
|
||||
}
|
||||
|
||||
func (GroupSubject) SwaggerDoc() map[string]string {
|
||||
return map_GroupSubject
|
||||
}
|
||||
|
||||
var map_LimitResponse = map[string]string{
|
||||
"": "LimitResponse defines how to handle requests that can not be executed right now.",
|
||||
"type": "`type` is \"Queue\" or \"Reject\". \"Queue\" means that requests that can not be executed upon arrival are held in a queue until they can be executed or a queuing limit is reached. \"Reject\" means that requests that can not be executed upon arrival are rejected. Required.",
|
||||
"queuing": "`queuing` holds the configuration parameters for queuing. This field may be non-empty only if `type` is `\"Queue\"`.",
|
||||
}
|
||||
|
||||
func (LimitResponse) SwaggerDoc() map[string]string {
|
||||
return map_LimitResponse
|
||||
}
|
||||
|
||||
var map_LimitedPriorityLevelConfiguration = map[string]string{
|
||||
"": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n * How are requests for this priority level limited?\n * What should be done with requests that exceed the limit?",
|
||||
"assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be exeucting at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ",
|
||||
"limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now",
|
||||
}
|
||||
|
||||
func (LimitedPriorityLevelConfiguration) SwaggerDoc() map[string]string {
|
||||
return map_LimitedPriorityLevelConfiguration
|
||||
}
|
||||
|
||||
var map_NonResourcePolicyRule = map[string]string{
|
||||
"": "NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.",
|
||||
"verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs. If it is present, it must be the only entry. Required.",
|
||||
"nonResourceURLs": "`nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. For example:\n - \"/healthz\" is legal\n - \"/hea*\" is illegal\n - \"/hea\" is legal but matches nothing\n - \"/hea/*\" also matches nothing\n - \"/healthz/*\" matches all per-component health checks.\n\"*\" matches all non-resource urls. if it is present, it must be the only entry. Required.",
|
||||
}
|
||||
|
||||
func (NonResourcePolicyRule) SwaggerDoc() map[string]string {
|
||||
return map_NonResourcePolicyRule
|
||||
}
|
||||
|
||||
var map_PolicyRulesWithSubjects = map[string]string{
|
||||
"": "PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.",
|
||||
"subjects": "subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.",
|
||||
"resourceRules": "`resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.",
|
||||
"nonResourceRules": "`nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.",
|
||||
}
|
||||
|
||||
func (PolicyRulesWithSubjects) SwaggerDoc() map[string]string {
|
||||
return map_PolicyRulesWithSubjects
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfiguration = map[string]string{
|
||||
"": "PriorityLevelConfiguration represents the configuration of a priority level.",
|
||||
"metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"spec": "`spec` is the specification of the desired behavior of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
|
||||
"status": "`status` is the current status of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfiguration) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfiguration
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfigurationCondition = map[string]string{
|
||||
"": "PriorityLevelConfigurationCondition defines the condition of priority level.",
|
||||
"type": "`type` is the type of the condition. Required.",
|
||||
"status": "`status` is the status of the condition. Can be True, False, Unknown. Required.",
|
||||
"lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.",
|
||||
"reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.",
|
||||
"message": "`message` is a human-readable message indicating details about last transition.",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfigurationCondition) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfigurationCondition
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfigurationList = map[string]string{
|
||||
"": "PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.",
|
||||
"metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"items": "`items` is a list of request-priorities.",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfigurationList) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfigurationList
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfigurationReference = map[string]string{
|
||||
"": "PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used.",
|
||||
"name": "`name` is the name of the priority level configuration being referenced Required.",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfigurationReference) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfigurationReference
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfigurationSpec = map[string]string{
|
||||
"": "PriorityLevelConfigurationSpec specifies the configuration of a priority level.",
|
||||
"type": "`type` indicates whether this priority level is subject to limitation on request execution. A value of `\"Exempt\"` means that requests of this priority level are not subject to a limit (and thus are never queued) and do not detract from the capacity made available to other priority levels. A value of `\"Limited\"` means that (a) requests of this priority level _are_ subject to limits and (b) some of the server's limited capacity is made available exclusively to this priority level. Required.",
|
||||
"limited": "`limited` specifies how requests are handled for a Limited priority level. This field must be non-empty if and only if `type` is `\"Limited\"`.",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfigurationSpec) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfigurationSpec
|
||||
}
|
||||
|
||||
var map_PriorityLevelConfigurationStatus = map[string]string{
|
||||
"": "PriorityLevelConfigurationStatus represents the current state of a \"request-priority\".",
|
||||
"conditions": "`conditions` is the current state of \"request-priority\".",
|
||||
}
|
||||
|
||||
func (PriorityLevelConfigurationStatus) SwaggerDoc() map[string]string {
|
||||
return map_PriorityLevelConfigurationStatus
|
||||
}
|
||||
|
||||
var map_QueuingConfiguration = map[string]string{
|
||||
"": "QueuingConfiguration holds the configuration parameters for queuing",
|
||||
"queues": "`queues` is the number of queues for this priority level. The queues exist independently at each apiserver. The value must be positive. Setting it to 1 effectively precludes shufflesharding and thus makes the distinguisher method of associated flow schemas irrelevant. This field has a default value of 64.",
|
||||
"handSize": "`handSize` is a small positive number that configures the shuffle sharding of requests into queues. When enqueuing a request at this priority level the request's flow identifier (a string pair) is hashed and the hash value is used to shuffle the list of queues and deal a hand of the size specified here. The request is put into one of the shortest queues in that hand. `handSize` must be no larger than `queues`, and should be significantly smaller (so that a few heavy flows do not saturate most of the queues). See the user-facing documentation for more extensive guidance on setting this field. This field has a default value of 8.",
|
||||
"queueLengthLimit": "`queueLengthLimit` is the maximum number of requests allowed to be waiting in a given queue of this priority level at a time; excess requests are rejected. This value must be positive. If not specified, it will be defaulted to 50.",
|
||||
}
|
||||
|
||||
func (QueuingConfiguration) SwaggerDoc() map[string]string {
|
||||
return map_QueuingConfiguration
|
||||
}
|
||||
|
||||
var map_ResourcePolicyRule = map[string]string{
|
||||
"": "ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) least one member of namespaces matches the request.",
|
||||
"verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required.",
|
||||
"apiGroups": "`apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required.",
|
||||
"resources": "`resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required.",
|
||||
"clusterScope": "`clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.",
|
||||
"namespaces": "`namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.",
|
||||
}
|
||||
|
||||
func (ResourcePolicyRule) SwaggerDoc() map[string]string {
|
||||
return map_ResourcePolicyRule
|
||||
}
|
||||
|
||||
var map_ServiceAccountSubject = map[string]string{
|
||||
"": "ServiceAccountSubject holds detailed information for service-account-kind subject.",
|
||||
"namespace": "`namespace` is the namespace of matching ServiceAccount objects. Required.",
|
||||
"name": "`name` is the name of matching ServiceAccount objects, or \"*\" to match regardless of name. Required.",
|
||||
}
|
||||
|
||||
func (ServiceAccountSubject) SwaggerDoc() map[string]string {
|
||||
return map_ServiceAccountSubject
|
||||
}
|
||||
|
||||
var map_Subject = map[string]string{
|
||||
"": "Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.",
|
||||
"kind": "`kind` indicates which one of the other fields is non-empty. Required",
|
||||
"user": "`user` matches based on username.",
|
||||
"group": "`group` matches based on user group name.",
|
||||
"serviceAccount": "`serviceAccount` matches ServiceAccounts.",
|
||||
}
|
||||
|
||||
func (Subject) SwaggerDoc() map[string]string {
|
||||
return map_Subject
|
||||
}
|
||||
|
||||
var map_UserSubject = map[string]string{
|
||||
"": "UserSubject holds detailed information for user-kind subject.",
|
||||
"name": "`name` is the username that matches, or \"*\" to match all usernames. Required.",
|
||||
}
|
||||
|
||||
func (UserSubject) SwaggerDoc() map[string]string {
|
||||
return map_UserSubject
|
||||
}
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS END HERE
|
542
staging/src/k8s.io/api/flowcontrol/v1beta2/zz_generated.deepcopy.go
generated
Normal file
542
staging/src/k8s.io/api/flowcontrol/v1beta2/zz_generated.deepcopy.go
generated
Normal file
@ -0,0 +1,542 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowDistinguisherMethod) DeepCopyInto(out *FlowDistinguisherMethod) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowDistinguisherMethod.
|
||||
func (in *FlowDistinguisherMethod) DeepCopy() *FlowDistinguisherMethod {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowDistinguisherMethod)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowSchema) DeepCopyInto(out *FlowSchema) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchema.
|
||||
func (in *FlowSchema) DeepCopy() *FlowSchema {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowSchema)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *FlowSchema) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowSchemaCondition) DeepCopyInto(out *FlowSchemaCondition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaCondition.
|
||||
func (in *FlowSchemaCondition) DeepCopy() *FlowSchemaCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowSchemaCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowSchemaList) DeepCopyInto(out *FlowSchemaList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]FlowSchema, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaList.
|
||||
func (in *FlowSchemaList) DeepCopy() *FlowSchemaList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowSchemaList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *FlowSchemaList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowSchemaSpec) DeepCopyInto(out *FlowSchemaSpec) {
|
||||
*out = *in
|
||||
out.PriorityLevelConfiguration = in.PriorityLevelConfiguration
|
||||
if in.DistinguisherMethod != nil {
|
||||
in, out := &in.DistinguisherMethod, &out.DistinguisherMethod
|
||||
*out = new(FlowDistinguisherMethod)
|
||||
**out = **in
|
||||
}
|
||||
if in.Rules != nil {
|
||||
in, out := &in.Rules, &out.Rules
|
||||
*out = make([]PolicyRulesWithSubjects, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaSpec.
|
||||
func (in *FlowSchemaSpec) DeepCopy() *FlowSchemaSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowSchemaSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FlowSchemaStatus) DeepCopyInto(out *FlowSchemaStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]FlowSchemaCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaStatus.
|
||||
func (in *FlowSchemaStatus) DeepCopy() *FlowSchemaStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FlowSchemaStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GroupSubject) DeepCopyInto(out *GroupSubject) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSubject.
|
||||
func (in *GroupSubject) DeepCopy() *GroupSubject {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GroupSubject)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LimitResponse) DeepCopyInto(out *LimitResponse) {
|
||||
*out = *in
|
||||
if in.Queuing != nil {
|
||||
in, out := &in.Queuing, &out.Queuing
|
||||
*out = new(QueuingConfiguration)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitResponse.
|
||||
func (in *LimitResponse) DeepCopy() *LimitResponse {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LimitResponse)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LimitedPriorityLevelConfiguration) DeepCopyInto(out *LimitedPriorityLevelConfiguration) {
|
||||
*out = *in
|
||||
in.LimitResponse.DeepCopyInto(&out.LimitResponse)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitedPriorityLevelConfiguration.
|
||||
func (in *LimitedPriorityLevelConfiguration) DeepCopy() *LimitedPriorityLevelConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LimitedPriorityLevelConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NonResourcePolicyRule) DeepCopyInto(out *NonResourcePolicyRule) {
|
||||
*out = *in
|
||||
if in.Verbs != nil {
|
||||
in, out := &in.Verbs, &out.Verbs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.NonResourceURLs != nil {
|
||||
in, out := &in.NonResourceURLs, &out.NonResourceURLs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NonResourcePolicyRule.
|
||||
func (in *NonResourcePolicyRule) DeepCopy() *NonResourcePolicyRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NonResourcePolicyRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PolicyRulesWithSubjects) DeepCopyInto(out *PolicyRulesWithSubjects) {
|
||||
*out = *in
|
||||
if in.Subjects != nil {
|
||||
in, out := &in.Subjects, &out.Subjects
|
||||
*out = make([]Subject, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.ResourceRules != nil {
|
||||
in, out := &in.ResourceRules, &out.ResourceRules
|
||||
*out = make([]ResourcePolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.NonResourceRules != nil {
|
||||
in, out := &in.NonResourceRules, &out.NonResourceRules
|
||||
*out = make([]NonResourcePolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRulesWithSubjects.
|
||||
func (in *PolicyRulesWithSubjects) DeepCopy() *PolicyRulesWithSubjects {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PolicyRulesWithSubjects)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfiguration) DeepCopyInto(out *PriorityLevelConfiguration) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfiguration.
|
||||
func (in *PriorityLevelConfiguration) DeepCopy() *PriorityLevelConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *PriorityLevelConfiguration) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfigurationCondition) DeepCopyInto(out *PriorityLevelConfigurationCondition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationCondition.
|
||||
func (in *PriorityLevelConfigurationCondition) DeepCopy() *PriorityLevelConfigurationCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfigurationCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfigurationList) DeepCopyInto(out *PriorityLevelConfigurationList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]PriorityLevelConfiguration, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationList.
|
||||
func (in *PriorityLevelConfigurationList) DeepCopy() *PriorityLevelConfigurationList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfigurationList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *PriorityLevelConfigurationList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfigurationReference) DeepCopyInto(out *PriorityLevelConfigurationReference) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationReference.
|
||||
func (in *PriorityLevelConfigurationReference) DeepCopy() *PriorityLevelConfigurationReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfigurationReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfigurationSpec) DeepCopyInto(out *PriorityLevelConfigurationSpec) {
|
||||
*out = *in
|
||||
if in.Limited != nil {
|
||||
in, out := &in.Limited, &out.Limited
|
||||
*out = new(LimitedPriorityLevelConfiguration)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationSpec.
|
||||
func (in *PriorityLevelConfigurationSpec) DeepCopy() *PriorityLevelConfigurationSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfigurationSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityLevelConfigurationStatus) DeepCopyInto(out *PriorityLevelConfigurationStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]PriorityLevelConfigurationCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationStatus.
|
||||
func (in *PriorityLevelConfigurationStatus) DeepCopy() *PriorityLevelConfigurationStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityLevelConfigurationStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *QueuingConfiguration) DeepCopyInto(out *QueuingConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueuingConfiguration.
|
||||
func (in *QueuingConfiguration) DeepCopy() *QueuingConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(QueuingConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourcePolicyRule) DeepCopyInto(out *ResourcePolicyRule) {
|
||||
*out = *in
|
||||
if in.Verbs != nil {
|
||||
in, out := &in.Verbs, &out.Verbs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.APIGroups != nil {
|
||||
in, out := &in.APIGroups, &out.APIGroups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Resources != nil {
|
||||
in, out := &in.Resources, &out.Resources
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Namespaces != nil {
|
||||
in, out := &in.Namespaces, &out.Namespaces
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRule.
|
||||
func (in *ResourcePolicyRule) DeepCopy() *ResourcePolicyRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourcePolicyRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceAccountSubject) DeepCopyInto(out *ServiceAccountSubject) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountSubject.
|
||||
func (in *ServiceAccountSubject) DeepCopy() *ServiceAccountSubject {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceAccountSubject)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Subject) DeepCopyInto(out *Subject) {
|
||||
*out = *in
|
||||
if in.User != nil {
|
||||
in, out := &in.User, &out.User
|
||||
*out = new(UserSubject)
|
||||
**out = **in
|
||||
}
|
||||
if in.Group != nil {
|
||||
in, out := &in.Group, &out.Group
|
||||
*out = new(GroupSubject)
|
||||
**out = **in
|
||||
}
|
||||
if in.ServiceAccount != nil {
|
||||
in, out := &in.ServiceAccount, &out.ServiceAccount
|
||||
*out = new(ServiceAccountSubject)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subject.
|
||||
func (in *Subject) DeepCopy() *Subject {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Subject)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UserSubject) DeepCopyInto(out *UserSubject) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSubject.
|
||||
func (in *UserSubject) DeepCopy() *UserSubject {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UserSubject)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
94
staging/src/k8s.io/api/flowcontrol/v1beta2/zz_generated.prerelease-lifecycle.go
generated
Normal file
94
staging/src/k8s.io/api/flowcontrol/v1beta2/zz_generated.prerelease-lifecycle.go
generated
Normal file
@ -0,0 +1,94 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *FlowSchema) APILifecycleIntroduced() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
|
||||
func (in *FlowSchema) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 26
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *FlowSchema) APILifecycleRemoved() (major, minor int) {
|
||||
return 1, 29
|
||||
}
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *FlowSchemaList) APILifecycleIntroduced() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
|
||||
func (in *FlowSchemaList) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 26
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *FlowSchemaList) APILifecycleRemoved() (major, minor int) {
|
||||
return 1, 29
|
||||
}
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleIntroduced() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 26
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleRemoved() (major, minor int) {
|
||||
return 1, 29
|
||||
}
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleIntroduced() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 26
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleRemoved() (major, minor int) {
|
||||
return 1, 29
|
||||
}
|
@ -19,7 +19,7 @@ package bootstrap
|
||||
import (
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apiserver/pkg/authentication/serviceaccount"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
"runtime"
|
||||
"sync/atomic"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
apitypes "k8s.io/apimachinery/pkg/types"
|
||||
epmetrics "k8s.io/apiserver/pkg/endpoints/metrics"
|
||||
apirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
|
@ -29,7 +29,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
@ -1080,7 +1080,7 @@ func startAPFController(t *testing.T, stopCh <-chan struct{}, apfConfiguration [
|
||||
clientset := newClientset(t, apfConfiguration...)
|
||||
// this test does not rely on resync, so resync period is set to zero
|
||||
factory := informers.NewSharedInformerFactory(clientset, 0)
|
||||
controller := utilflowcontrol.New(factory, clientset.FlowcontrolV1beta1(), serverConcurrency, requestWaitLimit)
|
||||
controller := utilflowcontrol.New(factory, clientset.FlowcontrolV1beta2(), serverConcurrency, requestWaitLimit)
|
||||
|
||||
factory.Start(stopCh)
|
||||
|
||||
|
@ -143,7 +143,7 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error {
|
||||
}
|
||||
config.FlowControl = utilflowcontrol.New(
|
||||
config.SharedInformerFactory,
|
||||
kubernetes.NewForConfigOrDie(config.ClientConfig).FlowcontrolV1beta1(),
|
||||
kubernetes.NewForConfigOrDie(config.ClientConfig).FlowcontrolV1beta2(),
|
||||
config.MaxRequestsInFlight+config.MaxMutatingRequestsInFlight,
|
||||
config.RequestTimeout/4,
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ package apihelpers
|
||||
import (
|
||||
"sort"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// SetFlowSchemaCondition sets conditions.
|
||||
|
@ -52,9 +52,9 @@ import (
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrollister "k8s.io/client-go/listers/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
flowcontrollister "k8s.io/client-go/listers/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
const timeFmt = "2006-01-02T15:04:05.999"
|
||||
@ -123,7 +123,7 @@ type configController struct {
|
||||
fsLister flowcontrollister.FlowSchemaLister
|
||||
fsInformerSynced cache.InformerSynced
|
||||
|
||||
flowcontrolClient flowcontrolclient.FlowcontrolV1beta1Interface
|
||||
flowcontrolClient flowcontrolclient.FlowcontrolV1beta2Interface
|
||||
|
||||
// serverConcurrencyLimit is the limit on the server's total
|
||||
// number of non-exempt requests being served at once. This comes
|
||||
@ -217,7 +217,7 @@ func newTestableController(config TestableConfig) *configController {
|
||||
cfgCtlr.configQueue = workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(200*time.Millisecond, 8*time.Hour), "priority_and_fairness_config_queue")
|
||||
// ensure the data structure reflects the mandatory config
|
||||
cfgCtlr.lockAndDigestConfigObjects(nil, nil)
|
||||
fci := config.InformerFactory.Flowcontrol().V1beta1()
|
||||
fci := config.InformerFactory.Flowcontrol().V1beta2()
|
||||
pli := fci.PriorityLevelConfigurations()
|
||||
fsi := fci.FlowSchemas()
|
||||
cfgCtlr.plLister = pli.Lister()
|
||||
|
@ -30,8 +30,8 @@ import (
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/utils/clock"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// ConfigConsumerAsFieldManager is how the config consuminng
|
||||
@ -78,7 +78,7 @@ type Interface interface {
|
||||
// New creates a new instance to implement API priority and fairness
|
||||
func New(
|
||||
informerFactory kubeinformers.SharedInformerFactory,
|
||||
flowcontrolClient flowcontrolclient.FlowcontrolV1beta1Interface,
|
||||
flowcontrolClient flowcontrolclient.FlowcontrolV1beta2Interface,
|
||||
serverConcurrencyLimit int,
|
||||
requestWaitLimit time.Duration,
|
||||
) Interface {
|
||||
@ -123,7 +123,7 @@ type TestableConfig struct {
|
||||
InformerFactory kubeinformers.SharedInformerFactory
|
||||
|
||||
// FlowcontrolClient to use for manipulating config objects
|
||||
FlowcontrolClient flowcontrolclient.FlowcontrolV1beta1Interface
|
||||
FlowcontrolClient flowcontrolclient.FlowcontrolV1beta2Interface
|
||||
|
||||
// ServerConcurrencyLimit for the controller to enforce
|
||||
ServerConcurrencyLimit int
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/clock"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
@ -39,7 +39,7 @@ import (
|
||||
fcrequest "k8s.io/apiserver/pkg/util/flowcontrol/request"
|
||||
"k8s.io/client-go/informers"
|
||||
clientsetfake "k8s.io/client-go/kubernetes/fake"
|
||||
fcclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
fcclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
@ -70,7 +70,7 @@ func (cfgCtlr *configController) hasPriorityLevelState(plName string) bool {
|
||||
type ctlrTestState struct {
|
||||
t *testing.T
|
||||
cfgCtlr *configController
|
||||
fcIfc fcclient.FlowcontrolV1beta1Interface
|
||||
fcIfc fcclient.FlowcontrolV1beta2Interface
|
||||
existingPLs map[string]*flowcontrol.PriorityLevelConfiguration
|
||||
existingFSs map[string]*flowcontrol.FlowSchema
|
||||
heldRequestsMap map[string][]heldRequest
|
||||
@ -244,7 +244,7 @@ func TestConfigConsumer(t *testing.T) {
|
||||
t.Run(fmt.Sprintf("trial%d:", i), func(t *testing.T) {
|
||||
clientset := clientsetfake.NewSimpleClientset()
|
||||
informerFactory := informers.NewSharedInformerFactory(clientset, 0)
|
||||
flowcontrolClient := clientset.FlowcontrolV1beta1()
|
||||
flowcontrolClient := clientset.FlowcontrolV1beta2()
|
||||
cts := &ctlrTestState{t: t,
|
||||
fcIfc: flowcontrolClient,
|
||||
existingFSs: map[string]*flowcontrol.FlowSchema{},
|
||||
@ -375,7 +375,7 @@ func TestAPFControllerWithGracefulShutdown(t *testing.T) {
|
||||
|
||||
clientset := clientsetfake.NewSimpleClientset(fs, pl)
|
||||
informerFactory := informers.NewSharedInformerFactory(clientset, time.Second)
|
||||
flowcontrolClient := clientset.FlowcontrolV1beta1()
|
||||
flowcontrolClient := clientset.FlowcontrolV1beta2()
|
||||
cts := &ctlrTestState{t: t,
|
||||
fcIfc: flowcontrolClient,
|
||||
existingFSs: map[string]*flowcontrol.FlowSchema{},
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
fcboot "k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap"
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
@ -19,7 +19,7 @@ package flowcontrol
|
||||
import (
|
||||
"strings"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apiserver/pkg/authentication/serviceaccount"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use
|
||||
// with apply.
|
||||
type FlowDistinguisherMethodApplyConfiguration struct {
|
||||
Type *v1beta2.FlowDistinguisherMethodType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with
|
||||
// apply.
|
||||
func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration {
|
||||
return &FlowDistinguisherMethodApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Type field is set to the value of the last call.
|
||||
func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1beta2.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use
|
||||
// with apply.
|
||||
type FlowSchemaApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// FlowSchema constructs an declarative configuration of the FlowSchema type for use with
|
||||
// apply.
|
||||
func FlowSchema(name string) *FlowSchemaApplyConfiguration {
|
||||
b := &FlowSchemaApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("FlowSchema")
|
||||
b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractFlowSchema extracts the applied configuration owned by fieldManager from
|
||||
// flowSchema. If no managedFields are found in flowSchema for fieldManager, a
|
||||
// FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API.
|
||||
// ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractFlowSchema(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) {
|
||||
return extractFlowSchema(flowSchema, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractFlowSchemaStatus is the same as ExtractFlowSchema except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) {
|
||||
return extractFlowSchema(flowSchema, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractFlowSchema(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) {
|
||||
b := &FlowSchemaApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta2.FlowSchema"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(flowSchema.Name)
|
||||
|
||||
b.WithKind("FlowSchema")
|
||||
b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Kind field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the APIVersion field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the GenerateName field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Namespace field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSelfLink sets the SelfLink field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the SelfLink field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithSelfLink(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.SelfLink = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the UID field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ResourceVersion field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Generation field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLabels puts the entries into the Labels field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, the entries provided by each call will be put on the Labels field,
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Labels == nil && len(entries) > 0 {
|
||||
b.Labels = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Labels[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, the entries provided by each call will be put on the Annotations field,
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Annotations == nil && len(entries) > 0 {
|
||||
b.Annotations = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Annotations[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
|
||||
func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Finalizers field.
|
||||
func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithClusterName sets the ClusterName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ClusterName field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithClusterName(value string) *FlowSchemaApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ClusterName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Spec field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Status field is set to the value of the last call.
|
||||
func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use
|
||||
// with apply.
|
||||
type FlowSchemaConditionApplyConfiguration struct {
|
||||
Type *v1beta2.FlowSchemaConditionType `json:"type,omitempty"`
|
||||
Status *v1beta2.ConditionStatus `json:"status,omitempty"`
|
||||
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with
|
||||
// apply.
|
||||
func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration {
|
||||
return &FlowSchemaConditionApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Type field is set to the value of the last call.
|
||||
func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1beta2.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Status field is set to the value of the last call.
|
||||
func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1beta2.ConditionStatus) *FlowSchemaConditionApplyConfiguration {
|
||||
b.Status = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the LastTransitionTime field is set to the value of the last call.
|
||||
func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *FlowSchemaConditionApplyConfiguration {
|
||||
b.LastTransitionTime = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReason sets the Reason field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Reason field is set to the value of the last call.
|
||||
func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration {
|
||||
b.Reason = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessage sets the Message field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Message field is set to the value of the last call.
|
||||
func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use
|
||||
// with apply.
|
||||
type FlowSchemaSpecApplyConfiguration struct {
|
||||
PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"`
|
||||
MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"`
|
||||
DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"`
|
||||
Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with
|
||||
// apply.
|
||||
func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration {
|
||||
return &FlowSchemaSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call.
|
||||
func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
|
||||
b.PriorityLevelConfiguration = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the MatchingPrecedence field is set to the value of the last call.
|
||||
func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration {
|
||||
b.MatchingPrecedence = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DistinguisherMethod field is set to the value of the last call.
|
||||
func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
|
||||
b.DistinguisherMethod = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRules adds the given value to the Rules field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Rules field.
|
||||
func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithRules")
|
||||
}
|
||||
b.Rules = append(b.Rules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use
|
||||
// with apply.
|
||||
type FlowSchemaStatusApplyConfiguration struct {
|
||||
Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with
|
||||
// apply.
|
||||
func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration {
|
||||
return &FlowSchemaStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Conditions field.
|
||||
func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use
|
||||
// with apply.
|
||||
type GroupSubjectApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with
|
||||
// apply.
|
||||
func GroupSubject() *GroupSubjectApplyConfiguration {
|
||||
return &GroupSubjectApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use
|
||||
// with apply.
|
||||
type LimitedPriorityLevelConfigurationApplyConfiguration struct {
|
||||
AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"`
|
||||
LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"`
|
||||
}
|
||||
|
||||
// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with
|
||||
// apply.
|
||||
func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration {
|
||||
return &LimitedPriorityLevelConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithAssuredConcurrencyShares sets the AssuredConcurrencyShares field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the AssuredConcurrencyShares field is set to the value of the last call.
|
||||
func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithAssuredConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration {
|
||||
b.AssuredConcurrencyShares = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the LimitResponse field is set to the value of the last call.
|
||||
func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration {
|
||||
b.LimitResponse = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use
|
||||
// with apply.
|
||||
type LimitResponseApplyConfiguration struct {
|
||||
Type *v1beta2.LimitResponseType `json:"type,omitempty"`
|
||||
Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"`
|
||||
}
|
||||
|
||||
// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with
|
||||
// apply.
|
||||
func LimitResponse() *LimitResponseApplyConfiguration {
|
||||
return &LimitResponseApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Type field is set to the value of the last call.
|
||||
func (b *LimitResponseApplyConfiguration) WithType(value v1beta2.LimitResponseType) *LimitResponseApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithQueuing sets the Queuing field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Queuing field is set to the value of the last call.
|
||||
func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration {
|
||||
b.Queuing = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use
|
||||
// with apply.
|
||||
type NonResourcePolicyRuleApplyConfiguration struct {
|
||||
Verbs []string `json:"verbs,omitempty"`
|
||||
NonResourceURLs []string `json:"nonResourceURLs,omitempty"`
|
||||
}
|
||||
|
||||
// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with
|
||||
// apply.
|
||||
func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration {
|
||||
return &NonResourcePolicyRuleApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithVerbs adds the given value to the Verbs field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Verbs field.
|
||||
func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Verbs = append(b.Verbs, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the NonResourceURLs field.
|
||||
func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.NonResourceURLs = append(b.NonResourceURLs, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use
|
||||
// with apply.
|
||||
type PolicyRulesWithSubjectsApplyConfiguration struct {
|
||||
Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"`
|
||||
ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"`
|
||||
NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"`
|
||||
}
|
||||
|
||||
// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with
|
||||
// apply.
|
||||
func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration {
|
||||
return &PolicyRulesWithSubjectsApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSubjects adds the given value to the Subjects field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Subjects field.
|
||||
func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithSubjects")
|
||||
}
|
||||
b.Subjects = append(b.Subjects, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceRules adds the given value to the ResourceRules field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the ResourceRules field.
|
||||
func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResourceRules")
|
||||
}
|
||||
b.ResourceRules = append(b.ResourceRules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the NonResourceRules field.
|
||||
func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithNonResourceRules")
|
||||
}
|
||||
b.NonResourceRules = append(b.NonResourceRules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use
|
||||
// with apply.
|
||||
type PriorityLevelConfigurationApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with
|
||||
// apply.
|
||||
func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b := &PriorityLevelConfigurationApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("PriorityLevelConfiguration")
|
||||
b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from
|
||||
// priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a
|
||||
// PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) {
|
||||
return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) {
|
||||
return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) {
|
||||
b := &PriorityLevelConfigurationApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfiguration"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(priorityLevelConfiguration.Name)
|
||||
|
||||
b.WithKind("PriorityLevelConfiguration")
|
||||
b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Kind field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the APIVersion field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the GenerateName field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Namespace field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSelfLink sets the SelfLink field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the SelfLink field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithSelfLink(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.SelfLink = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the UID field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ResourceVersion field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Generation field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLabels puts the entries into the Labels field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, the entries provided by each call will be put on the Labels field,
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Labels == nil && len(entries) > 0 {
|
||||
b.Labels = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Labels[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, the entries provided by each call will be put on the Annotations field,
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Annotations == nil && len(entries) > 0 {
|
||||
b.Annotations = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Annotations[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Finalizers field.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithClusterName sets the ClusterName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ClusterName field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithClusterName(value string) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ClusterName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Spec field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Status field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use
|
||||
// with apply.
|
||||
type PriorityLevelConfigurationConditionApplyConfiguration struct {
|
||||
Type *v1beta2.PriorityLevelConfigurationConditionType `json:"type,omitempty"`
|
||||
Status *v1beta2.ConditionStatus `json:"status,omitempty"`
|
||||
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with
|
||||
// apply.
|
||||
func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
return &PriorityLevelConfigurationConditionApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Type field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1beta2.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Status field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1beta2.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
b.Status = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the LastTransitionTime field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
b.LastTransitionTime = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReason sets the Reason field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Reason field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
b.Reason = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessage sets the Message field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Message field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use
|
||||
// with apply.
|
||||
type PriorityLevelConfigurationReferenceApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with
|
||||
// apply.
|
||||
func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration {
|
||||
return &PriorityLevelConfigurationReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use
|
||||
// with apply.
|
||||
type PriorityLevelConfigurationSpecApplyConfiguration struct {
|
||||
Type *v1beta2.PriorityLevelEnablement `json:"type,omitempty"`
|
||||
Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with
|
||||
// apply.
|
||||
func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration {
|
||||
return &PriorityLevelConfigurationSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Type field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1beta2.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLimited sets the Limited field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Limited field is set to the value of the last call.
|
||||
func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration {
|
||||
b.Limited = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use
|
||||
// with apply.
|
||||
type PriorityLevelConfigurationStatusApplyConfiguration struct {
|
||||
Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with
|
||||
// apply.
|
||||
func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration {
|
||||
return &PriorityLevelConfigurationStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Conditions field.
|
||||
func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use
|
||||
// with apply.
|
||||
type QueuingConfigurationApplyConfiguration struct {
|
||||
Queues *int32 `json:"queues,omitempty"`
|
||||
HandSize *int32 `json:"handSize,omitempty"`
|
||||
QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"`
|
||||
}
|
||||
|
||||
// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with
|
||||
// apply.
|
||||
func QueuingConfiguration() *QueuingConfigurationApplyConfiguration {
|
||||
return &QueuingConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithQueues sets the Queues field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Queues field is set to the value of the last call.
|
||||
func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration {
|
||||
b.Queues = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithHandSize sets the HandSize field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the HandSize field is set to the value of the last call.
|
||||
func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration {
|
||||
b.HandSize = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the QueueLengthLimit field is set to the value of the last call.
|
||||
func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration {
|
||||
b.QueueLengthLimit = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use
|
||||
// with apply.
|
||||
type ResourcePolicyRuleApplyConfiguration struct {
|
||||
Verbs []string `json:"verbs,omitempty"`
|
||||
APIGroups []string `json:"apiGroups,omitempty"`
|
||||
Resources []string `json:"resources,omitempty"`
|
||||
ClusterScope *bool `json:"clusterScope,omitempty"`
|
||||
Namespaces []string `json:"namespaces,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with
|
||||
// apply.
|
||||
func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration {
|
||||
return &ResourcePolicyRuleApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithVerbs adds the given value to the Verbs field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Verbs field.
|
||||
func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Verbs = append(b.Verbs, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIGroups adds the given value to the APIGroups field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the APIGroups field.
|
||||
func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.APIGroups = append(b.APIGroups, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResources adds the given value to the Resources field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Resources field.
|
||||
func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Resources = append(b.Resources, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithClusterScope sets the ClusterScope field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ClusterScope field is set to the value of the last call.
|
||||
func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration {
|
||||
b.ClusterScope = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespaces adds the given value to the Namespaces field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Namespaces field.
|
||||
func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Namespaces = append(b.Namespaces, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use
|
||||
// with apply.
|
||||
type ServiceAccountSubjectApplyConfiguration struct {
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with
|
||||
// apply.
|
||||
func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration {
|
||||
return &ServiceAccountSubjectApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Namespace field is set to the value of the last call.
|
||||
func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration {
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
)
|
||||
|
||||
// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use
|
||||
// with apply.
|
||||
type SubjectApplyConfiguration struct {
|
||||
Kind *v1beta2.SubjectKind `json:"kind,omitempty"`
|
||||
User *UserSubjectApplyConfiguration `json:"user,omitempty"`
|
||||
Group *GroupSubjectApplyConfiguration `json:"group,omitempty"`
|
||||
ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"`
|
||||
}
|
||||
|
||||
// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with
|
||||
// apply.
|
||||
func Subject() *SubjectApplyConfiguration {
|
||||
return &SubjectApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithKind sets the Kind field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Kind field is set to the value of the last call.
|
||||
func (b *SubjectApplyConfiguration) WithKind(value v1beta2.SubjectKind) *SubjectApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUser sets the User field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the User field is set to the value of the last call.
|
||||
func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration {
|
||||
b.User = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGroup sets the Group field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Group field is set to the value of the last call.
|
||||
func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration {
|
||||
b.Group = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ServiceAccount field is set to the value of the last call.
|
||||
func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration {
|
||||
b.ServiceAccount = value
|
||||
return b
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use
|
||||
// with apply.
|
||||
type UserSubjectApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with
|
||||
// apply.
|
||||
func UserSubject() *UserSubjectApplyConfiguration {
|
||||
return &UserSubjectApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
@ -8398,6 +8398,314 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.FlowDistinguisherMethod
|
||||
map:
|
||||
fields:
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.FlowSchema
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaCondition
|
||||
map:
|
||||
fields:
|
||||
- name: lastTransitionTime
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
|
||||
default: {}
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: reason
|
||||
type:
|
||||
scalar: string
|
||||
- name: status
|
||||
type:
|
||||
scalar: string
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaSpec
|
||||
map:
|
||||
fields:
|
||||
- name: distinguisherMethod
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.FlowDistinguisherMethod
|
||||
- name: matchingPrecedence
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: priorityLevelConfiguration
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationReference
|
||||
default: {}
|
||||
- name: rules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.PolicyRulesWithSubjects
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaCondition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.GroupSubject
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.LimitResponse
|
||||
map:
|
||||
fields:
|
||||
- name: queuing
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.QueuingConfiguration
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
unions:
|
||||
- discriminator: type
|
||||
fields:
|
||||
- fieldName: queuing
|
||||
discriminatorValue: Queuing
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.LimitedPriorityLevelConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: assuredConcurrencyShares
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: limitResponse
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.LimitResponse
|
||||
default: {}
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.NonResourcePolicyRule
|
||||
map:
|
||||
fields:
|
||||
- name: nonResourceURLs
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: verbs
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PolicyRulesWithSubjects
|
||||
map:
|
||||
fields:
|
||||
- name: nonResourceRules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.NonResourcePolicyRule
|
||||
elementRelationship: atomic
|
||||
- name: resourceRules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.ResourcePolicyRule
|
||||
elementRelationship: atomic
|
||||
- name: subjects
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.Subject
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationCondition
|
||||
map:
|
||||
fields:
|
||||
- name: lastTransitionTime
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
|
||||
default: {}
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: reason
|
||||
type:
|
||||
scalar: string
|
||||
- name: status
|
||||
type:
|
||||
scalar: string
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationReference
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationSpec
|
||||
map:
|
||||
fields:
|
||||
- name: limited
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.LimitedPriorityLevelConfiguration
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
unions:
|
||||
- discriminator: type
|
||||
fields:
|
||||
- fieldName: limited
|
||||
discriminatorValue: Limited
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationCondition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.QueuingConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: handSize
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: queueLengthLimit
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: queues
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.ResourcePolicyRule
|
||||
map:
|
||||
fields:
|
||||
- name: apiGroups
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: clusterScope
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: namespaces
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: resources
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: verbs
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.ServiceAccountSubject
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: namespace
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.Subject
|
||||
map:
|
||||
fields:
|
||||
- name: group
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.GroupSubject
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: serviceAccount
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.ServiceAccountSubject
|
||||
- name: user
|
||||
type:
|
||||
namedType: io.k8s.api.flowcontrol.v1beta2.UserSubject
|
||||
unions:
|
||||
- discriminator: kind
|
||||
fields:
|
||||
- fieldName: group
|
||||
discriminatorValue: Group
|
||||
- fieldName: serviceAccount
|
||||
discriminatorValue: ServiceAccount
|
||||
- fieldName: user
|
||||
discriminatorValue: User
|
||||
- name: io.k8s.api.flowcontrol.v1beta2.UserSubject
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.imagepolicy.v1alpha1.ImageReview
|
||||
map:
|
||||
fields:
|
||||
|
@ -42,6 +42,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
@ -84,6 +85,7 @@ import (
|
||||
applyconfigurationsextensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
|
||||
flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1"
|
||||
applyconfigurationsflowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1"
|
||||
applyconfigurationsflowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2"
|
||||
applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1"
|
||||
applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1"
|
||||
@ -1004,6 +1006,48 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case flowcontrolv1beta1.SchemeGroupVersion.WithKind("UserSubject"):
|
||||
return &applyconfigurationsflowcontrolv1beta1.UserSubjectApplyConfiguration{}
|
||||
|
||||
// Group=flowcontrol.apiserver.k8s.io, Version=v1beta2
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.FlowDistinguisherMethodApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchema"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.FlowSchemaApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaCondition"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.FlowSchemaConditionApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaSpec"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.FlowSchemaSpecApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaStatus"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.FlowSchemaStatusApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("GroupSubject"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.GroupSubjectApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.LimitedPriorityLevelConfigurationApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitResponse"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.LimitResponseApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("NonResourcePolicyRule"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.NonResourcePolicyRuleApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PolicyRulesWithSubjectsApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationConditionApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationReferenceApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationSpecApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationStatusApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("QueuingConfiguration"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.QueuingConfigurationApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ResourcePolicyRule"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.ResourcePolicyRuleApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ServiceAccountSubject"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.ServiceAccountSubjectApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("Subject"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.SubjectApplyConfiguration{}
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithKind("UserSubject"):
|
||||
return &applyconfigurationsflowcontrolv1beta2.UserSubjectApplyConfiguration{}
|
||||
|
||||
// Group=imagepolicy.k8s.io, Version=v1alpha1
|
||||
case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReview"):
|
||||
return &applyconfigurationsimagepolicyv1alpha1.ImageReviewApplyConfiguration{}
|
||||
|
@ -21,6 +21,7 @@ package flowcontrol
|
||||
import (
|
||||
v1alpha1 "k8s.io/client-go/informers/flowcontrol/v1alpha1"
|
||||
v1beta1 "k8s.io/client-go/informers/flowcontrol/v1beta1"
|
||||
v1beta2 "k8s.io/client-go/informers/flowcontrol/v1beta2"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
)
|
||||
|
||||
@ -30,6 +31,8 @@ type Interface interface {
|
||||
V1alpha1() v1alpha1.Interface
|
||||
// V1beta1 provides access to shared informers for resources in V1beta1.
|
||||
V1beta1() v1beta1.Interface
|
||||
// V1beta2 provides access to shared informers for resources in V1beta2.
|
||||
V1beta2() v1beta2.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
@ -52,3 +55,8 @@ func (g *group) V1alpha1() v1alpha1.Interface {
|
||||
func (g *group) V1beta1() v1beta1.Interface {
|
||||
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1beta2 returns a new v1beta2.Interface.
|
||||
func (g *group) V1beta2() v1beta2.Interface {
|
||||
return v1beta2.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1beta2 "k8s.io/client-go/listers/flowcontrol/v1beta2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// FlowSchemaInformer provides access to a shared informer and lister for
|
||||
// FlowSchemas.
|
||||
type FlowSchemaInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta2.FlowSchemaLister
|
||||
}
|
||||
|
||||
type flowSchemaInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewFlowSchemaInformer constructs a new informer for FlowSchema type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlowcontrolV1beta2().FlowSchemas().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlowcontrolV1beta2().FlowSchemas().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&flowcontrolv1beta2.FlowSchema{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&flowcontrolv1beta2.FlowSchema{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *flowSchemaInformer) Lister() v1beta2.FlowSchemaLister {
|
||||
return v1beta2.NewFlowSchemaLister(f.Informer().GetIndexer())
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// FlowSchemas returns a FlowSchemaInformer.
|
||||
FlowSchemas() FlowSchemaInformer
|
||||
// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer.
|
||||
PriorityLevelConfigurations() PriorityLevelConfigurationInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// FlowSchemas returns a FlowSchemaInformer.
|
||||
func (v *version) FlowSchemas() FlowSchemaInformer {
|
||||
return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer.
|
||||
func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer {
|
||||
return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1beta2 "k8s.io/client-go/listers/flowcontrol/v1beta2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationInformer provides access to a shared informer and lister for
|
||||
// PriorityLevelConfigurations.
|
||||
type PriorityLevelConfigurationInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta2.PriorityLevelConfigurationLister
|
||||
}
|
||||
|
||||
type priorityLevelConfigurationInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlowcontrolV1beta2().PriorityLevelConfigurations().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlowcontrolV1beta2().PriorityLevelConfigurations().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&flowcontrolv1beta2.PriorityLevelConfiguration{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&flowcontrolv1beta2.PriorityLevelConfiguration{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *priorityLevelConfigurationInformer) Lister() v1beta2.PriorityLevelConfigurationLister {
|
||||
return v1beta2.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer())
|
||||
}
|
@ -44,6 +44,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
nodev1 "k8s.io/api/node/v1"
|
||||
@ -248,6 +249,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case flowcontrolv1beta1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta1().PriorityLevelConfigurations().Informer()}, nil
|
||||
|
||||
// Group=flowcontrol.apiserver.k8s.io, Version=v1beta2
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithResource("flowschemas"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta2().FlowSchemas().Informer()}, nil
|
||||
case flowcontrolv1beta2.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta2().PriorityLevelConfigurations().Informer()}, nil
|
||||
|
||||
// Group=internal.apiserver.k8s.io, Version=v1alpha1
|
||||
case apiserverinternalv1alpha1.SchemeGroupVersion.WithResource("storageversions"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Internal().V1alpha1().StorageVersions().Informer()}, nil
|
||||
|
@ -49,6 +49,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1"
|
||||
flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
|
||||
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
|
||||
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
|
||||
@ -98,6 +99,7 @@ type Interface interface {
|
||||
ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface
|
||||
FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface
|
||||
FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface
|
||||
FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface
|
||||
NetworkingV1() networkingv1.NetworkingV1Interface
|
||||
NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface
|
||||
NodeV1() nodev1.NodeV1Interface
|
||||
@ -147,6 +149,7 @@ type Clientset struct {
|
||||
extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client
|
||||
flowcontrolV1alpha1 *flowcontrolv1alpha1.FlowcontrolV1alpha1Client
|
||||
flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1Client
|
||||
flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2Client
|
||||
networkingV1 *networkingv1.NetworkingV1Client
|
||||
networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client
|
||||
nodeV1 *nodev1.NodeV1Client
|
||||
@ -300,6 +303,11 @@ func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1In
|
||||
return c.flowcontrolV1beta1
|
||||
}
|
||||
|
||||
// FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client
|
||||
func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface {
|
||||
return c.flowcontrolV1beta2
|
||||
}
|
||||
|
||||
// NetworkingV1 retrieves the NetworkingV1Client
|
||||
func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface {
|
||||
return c.networkingV1
|
||||
@ -509,6 +517,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.flowcontrolV1beta2, err = flowcontrolv1beta2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.networkingV1, err = networkingv1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -612,6 +624,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.extensionsV1beta1 = extensionsv1beta1.NewForConfigOrDie(c)
|
||||
cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.NewForConfigOrDie(c)
|
||||
cs.flowcontrolV1beta1 = flowcontrolv1beta1.NewForConfigOrDie(c)
|
||||
cs.flowcontrolV1beta2 = flowcontrolv1beta2.NewForConfigOrDie(c)
|
||||
cs.networkingV1 = networkingv1.NewForConfigOrDie(c)
|
||||
cs.networkingV1beta1 = networkingv1beta1.NewForConfigOrDie(c)
|
||||
cs.nodeV1 = nodev1.NewForConfigOrDie(c)
|
||||
@ -663,6 +676,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.extensionsV1beta1 = extensionsv1beta1.New(c)
|
||||
cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.New(c)
|
||||
cs.flowcontrolV1beta1 = flowcontrolv1beta1.New(c)
|
||||
cs.flowcontrolV1beta2 = flowcontrolv1beta2.New(c)
|
||||
cs.networkingV1 = networkingv1.New(c)
|
||||
cs.networkingV1beta1 = networkingv1beta1.New(c)
|
||||
cs.nodeV1 = nodev1.New(c)
|
||||
|
@ -78,6 +78,8 @@ import (
|
||||
fakeflowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake"
|
||||
flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
fakeflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
fakeflowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake"
|
||||
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
|
||||
fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake"
|
||||
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
|
||||
@ -298,6 +300,11 @@ func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1In
|
||||
return &fakeflowcontrolv1beta1.FakeFlowcontrolV1beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client
|
||||
func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface {
|
||||
return &fakeflowcontrolv1beta2.FakeFlowcontrolV1beta2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// NetworkingV1 retrieves the NetworkingV1Client
|
||||
func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface {
|
||||
return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake}
|
||||
|
@ -46,6 +46,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
nodev1 "k8s.io/api/node/v1"
|
||||
@ -100,6 +101,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
extensionsv1beta1.AddToScheme,
|
||||
flowcontrolv1alpha1.AddToScheme,
|
||||
flowcontrolv1beta1.AddToScheme,
|
||||
flowcontrolv1beta2.AddToScheme,
|
||||
networkingv1.AddToScheme,
|
||||
networkingv1beta1.AddToScheme,
|
||||
nodev1.AddToScheme,
|
||||
|
@ -46,6 +46,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
nodev1 "k8s.io/api/node/v1"
|
||||
@ -100,6 +101,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
extensionsv1beta1.AddToScheme,
|
||||
flowcontrolv1alpha1.AddToScheme,
|
||||
flowcontrolv1beta1.AddToScheme,
|
||||
flowcontrolv1beta2.AddToScheme,
|
||||
networkingv1.AddToScheme,
|
||||
networkingv1beta1.AddToScheme,
|
||||
nodev1.AddToScheme,
|
||||
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1beta2
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeFlowcontrolV1beta2 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeFlowcontrolV1beta2) FlowSchemas() v1beta2.FlowSchemaInterface {
|
||||
return &FakeFlowSchemas{c}
|
||||
}
|
||||
|
||||
func (c *FakeFlowcontrolV1beta2) PriorityLevelConfigurations() v1beta2.PriorityLevelConfigurationInterface {
|
||||
return &FakePriorityLevelConfigurations{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeFlowcontrolV1beta2) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeFlowSchemas implements FlowSchemaInterface
|
||||
type FakeFlowSchemas struct {
|
||||
Fake *FakeFlowcontrolV1beta2
|
||||
}
|
||||
|
||||
var flowschemasResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Resource: "flowschemas"}
|
||||
|
||||
var flowschemasKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchema"}
|
||||
|
||||
// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any.
|
||||
func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
|
||||
func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1beta2.FlowSchemaList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.FlowSchemaList{ListMeta: obj.(*v1beta2.FlowSchemaList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.FlowSchemaList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested flowSchemas.
|
||||
func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any.
|
||||
func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any.
|
||||
func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(flowschemasResource, name), &v1beta2.FlowSchema{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.FlowSchemaList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched flowSchema.
|
||||
func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema.
|
||||
func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
if flowSchema == nil {
|
||||
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(flowSchema)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := flowSchema.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
if flowSchema == nil {
|
||||
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(flowSchema)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := flowSchema.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1beta2.FlowSchema{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), err
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface
|
||||
type FakePriorityLevelConfigurations struct {
|
||||
Fake *FakeFlowcontrolV1beta2
|
||||
}
|
||||
|
||||
var prioritylevelconfigurationsResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Resource: "prioritylevelconfigurations"}
|
||||
|
||||
var prioritylevelconfigurationsKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfiguration"}
|
||||
|
||||
// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any.
|
||||
func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
|
||||
func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1beta2.PriorityLevelConfigurationList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta2.PriorityLevelConfigurationList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.PriorityLevelConfigurationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
|
||||
func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
|
||||
func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
|
||||
func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(prioritylevelconfigurationsResource, name), &v1beta2.PriorityLevelConfiguration{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.PriorityLevelConfigurationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityLevelConfiguration.
|
||||
func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration.
|
||||
func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
if priorityLevelConfiguration == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(priorityLevelConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := priorityLevelConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
if priorityLevelConfiguration == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(priorityLevelConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := priorityLevelConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1beta2.PriorityLevelConfiguration{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), err
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type FlowcontrolV1beta2Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
FlowSchemasGetter
|
||||
PriorityLevelConfigurationsGetter
|
||||
}
|
||||
|
||||
// FlowcontrolV1beta2Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group.
|
||||
type FlowcontrolV1beta2Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *FlowcontrolV1beta2Client) FlowSchemas() FlowSchemaInterface {
|
||||
return newFlowSchemas(c)
|
||||
}
|
||||
|
||||
func (c *FlowcontrolV1beta2Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface {
|
||||
return newPriorityLevelConfigurations(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new FlowcontrolV1beta2Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*FlowcontrolV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &FlowcontrolV1beta2Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new FlowcontrolV1beta2Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1beta2Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new FlowcontrolV1beta2Client for the given RESTClient.
|
||||
func New(c rest.Interface) *FlowcontrolV1beta2Client {
|
||||
return &FlowcontrolV1beta2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta2.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FlowcontrolV1beta2Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// FlowSchemasGetter has a method to return a FlowSchemaInterface.
|
||||
// A group's client should implement this interface.
|
||||
type FlowSchemasGetter interface {
|
||||
FlowSchemas() FlowSchemaInterface
|
||||
}
|
||||
|
||||
// FlowSchemaInterface has methods to work with FlowSchema resources.
|
||||
type FlowSchemaInterface interface {
|
||||
Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (*v1beta2.FlowSchema, error)
|
||||
Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error)
|
||||
UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.FlowSchema, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.FlowSchemaList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error)
|
||||
Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error)
|
||||
ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error)
|
||||
FlowSchemaExpansion
|
||||
}
|
||||
|
||||
// flowSchemas implements FlowSchemaInterface
|
||||
type flowSchemas struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newFlowSchemas returns a FlowSchemas
|
||||
func newFlowSchemas(c *FlowcontrolV1beta2Client) *flowSchemas {
|
||||
return &flowSchemas{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any.
|
||||
func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Get().
|
||||
Resource("flowschemas").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
|
||||
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1beta2.FlowSchemaList{}
|
||||
err = c.client.Get().
|
||||
Resource("flowschemas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested flowSchemas.
|
||||
func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("flowschemas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any.
|
||||
func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Post().
|
||||
Resource("flowschemas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(flowSchema).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any.
|
||||
func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Put().
|
||||
Resource("flowschemas").
|
||||
Name(flowSchema.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(flowSchema).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Put().
|
||||
Resource("flowschemas").
|
||||
Name(flowSchema.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(flowSchema).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs.
|
||||
func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("flowschemas").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *flowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("flowschemas").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched flowSchema.
|
||||
func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) {
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("flowschemas").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema.
|
||||
func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
if flowSchema == nil {
|
||||
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(flowSchema)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := flowSchema.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("flowschemas").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) {
|
||||
if flowSchema == nil {
|
||||
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(flowSchema)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := flowSchema.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1beta2.FlowSchema{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("flowschemas").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
type FlowSchemaExpansion interface{}
|
||||
|
||||
type PriorityLevelConfigurationExpansion interface{}
|
@ -0,0 +1,243 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PriorityLevelConfigurationsGetter interface {
|
||||
PriorityLevelConfigurations() PriorityLevelConfigurationInterface
|
||||
}
|
||||
|
||||
// PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources.
|
||||
type PriorityLevelConfigurationInterface interface {
|
||||
Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta2.PriorityLevelConfiguration, error)
|
||||
Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error)
|
||||
UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.PriorityLevelConfiguration, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PriorityLevelConfigurationList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error)
|
||||
Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error)
|
||||
ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error)
|
||||
PriorityLevelConfigurationExpansion
|
||||
}
|
||||
|
||||
// priorityLevelConfigurations implements PriorityLevelConfigurationInterface
|
||||
type priorityLevelConfigurations struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newPriorityLevelConfigurations returns a PriorityLevelConfigurations
|
||||
func newPriorityLevelConfigurations(c *FlowcontrolV1beta2Client) *priorityLevelConfigurations {
|
||||
return &priorityLevelConfigurations{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any.
|
||||
func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Get().
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
|
||||
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1beta2.PriorityLevelConfigurationList{}
|
||||
err = c.client.Get().
|
||||
Resource("prioritylevelconfigurations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
|
||||
func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("prioritylevelconfigurations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
|
||||
func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Post().
|
||||
Resource("prioritylevelconfigurations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(priorityLevelConfiguration).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
|
||||
func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Put().
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(priorityLevelConfiguration.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(priorityLevelConfiguration).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Put().
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(priorityLevelConfiguration.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(priorityLevelConfiguration).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("prioritylevelconfigurations").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityLevelConfiguration.
|
||||
func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration.
|
||||
func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
if priorityLevelConfiguration == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(priorityLevelConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := priorityLevelConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) {
|
||||
if priorityLevelConfiguration == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(priorityLevelConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := priorityLevelConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1beta2.PriorityLevelConfiguration{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("prioritylevelconfigurations").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
// FlowSchemaListerExpansion allows custom methods to be added to
|
||||
// FlowSchemaLister.
|
||||
type FlowSchemaListerExpansion interface{}
|
||||
|
||||
// PriorityLevelConfigurationListerExpansion allows custom methods to be added to
|
||||
// PriorityLevelConfigurationLister.
|
||||
type PriorityLevelConfigurationListerExpansion interface{}
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// FlowSchemaLister helps list FlowSchemas.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type FlowSchemaLister interface {
|
||||
// List lists all FlowSchemas in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1beta2.FlowSchema, err error)
|
||||
// Get retrieves the FlowSchema from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1beta2.FlowSchema, error)
|
||||
FlowSchemaListerExpansion
|
||||
}
|
||||
|
||||
// flowSchemaLister implements the FlowSchemaLister interface.
|
||||
type flowSchemaLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewFlowSchemaLister returns a new FlowSchemaLister.
|
||||
func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister {
|
||||
return &flowSchemaLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all FlowSchemas in the indexer.
|
||||
func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1beta2.FlowSchema, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1beta2.FlowSchema))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the FlowSchema from the index for a given name.
|
||||
func (s *flowSchemaLister) Get(name string) (*v1beta2.FlowSchema, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1beta2.Resource("flowschema"), name)
|
||||
}
|
||||
return obj.(*v1beta2.FlowSchema), nil
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 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.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
v1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PriorityLevelConfigurationLister helps list PriorityLevelConfigurations.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type PriorityLevelConfigurationLister interface {
|
||||
// List lists all PriorityLevelConfigurations in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1beta2.PriorityLevelConfiguration, err error)
|
||||
// Get retrieves the PriorityLevelConfiguration from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1beta2.PriorityLevelConfiguration, error)
|
||||
PriorityLevelConfigurationListerExpansion
|
||||
}
|
||||
|
||||
// priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface.
|
||||
type priorityLevelConfigurationLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister.
|
||||
func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister {
|
||||
return &priorityLevelConfigurationLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all PriorityLevelConfigurations in the indexer.
|
||||
func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1beta2.PriorityLevelConfiguration, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1beta2.PriorityLevelConfiguration))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the PriorityLevelConfiguration from the index for a given name.
|
||||
func (s *priorityLevelConfigurationLister) Get(name string) (*v1beta2.PriorityLevelConfiguration, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1beta2.Resource("prioritylevelconfiguration"), name)
|
||||
}
|
||||
return obj.(*v1beta2.PriorityLevelConfiguration), nil
|
||||
}
|
@ -31,7 +31,7 @@ import (
|
||||
"github.com/prometheus/common/expfmt"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apiserver/pkg/util/apihelpers"
|
||||
@ -255,7 +255,7 @@ var _ = SIGDescribe("API priority and fairness", func() {
|
||||
// createPriorityLevel creates a priority level with the provided assured
|
||||
// concurrency share.
|
||||
func createPriorityLevel(f *framework.Framework, priorityLevelName string, assuredConcurrencyShares int32) (*flowcontrol.PriorityLevelConfiguration, func()) {
|
||||
createdPriorityLevel, err := f.ClientSet.FlowcontrolV1beta1().PriorityLevelConfigurations().Create(
|
||||
createdPriorityLevel, err := f.ClientSet.FlowcontrolV1beta2().PriorityLevelConfigurations().Create(
|
||||
context.TODO(),
|
||||
&flowcontrol.PriorityLevelConfiguration{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -274,7 +274,7 @@ func createPriorityLevel(f *framework.Framework, priorityLevelName string, assur
|
||||
metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
return createdPriorityLevel, func() {
|
||||
framework.ExpectNoError(f.ClientSet.FlowcontrolV1beta1().PriorityLevelConfigurations().Delete(context.TODO(), priorityLevelName, metav1.DeleteOptions{}))
|
||||
framework.ExpectNoError(f.ClientSet.FlowcontrolV1beta2().PriorityLevelConfigurations().Delete(context.TODO(), priorityLevelName, metav1.DeleteOptions{}))
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ func createFlowSchema(f *framework.Framework, flowSchemaName string, matchingPre
|
||||
})
|
||||
}
|
||||
|
||||
createdFlowSchema, err := f.ClientSet.FlowcontrolV1beta1().FlowSchemas().Create(
|
||||
createdFlowSchema, err := f.ClientSet.FlowcontrolV1beta2().FlowSchemas().Create(
|
||||
context.TODO(),
|
||||
&flowcontrol.FlowSchema{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -352,7 +352,7 @@ func createFlowSchema(f *framework.Framework, flowSchemaName string, matchingPre
|
||||
metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
return createdFlowSchema, func() {
|
||||
framework.ExpectNoError(f.ClientSet.FlowcontrolV1beta1().FlowSchemas().Delete(context.TODO(), flowSchemaName, metav1.DeleteOptions{}))
|
||||
framework.ExpectNoError(f.ClientSet.FlowcontrolV1beta2().FlowSchemas().Delete(context.TODO(), flowSchemaName, metav1.DeleteOptions{}))
|
||||
}
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ func createFlowSchema(f *framework.Framework, flowSchemaName string, matchingPre
|
||||
// schema status, and (2) metrics. The function times out after 30 seconds.
|
||||
func waitForSteadyState(f *framework.Framework, flowSchemaName string, priorityLevelName string) {
|
||||
framework.ExpectNoError(wait.Poll(time.Second, 30*time.Second, func() (bool, error) {
|
||||
fs, err := f.ClientSet.FlowcontrolV1beta1().FlowSchemas().Get(context.TODO(), flowSchemaName, metav1.GetOptions{})
|
||||
fs, err := f.ClientSet.FlowcontrolV1beta2().FlowSchemas().Get(context.TODO(), flowSchemaName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
@ -119,8 +119,10 @@ var resetFieldsSpecData = map[schema.GroupVersionResource]string{
|
||||
gvr("certificates.k8s.io", "v1beta1", "certificatesigningrequests"): `{}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1alpha1", "flowschemas"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"priorityLevelConfiguration": {"name": "name2"}}}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"priorityLevelConfiguration": {"name": "name2"}}}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "flowschemas"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"priorityLevelConfiguration": {"name": "name2"}}}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1alpha1", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
|
||||
gvr("extensions", "v1beta1", "ingresses"): `{"spec": {"backend": {"serviceName": "service2"}}}`,
|
||||
gvr("networking.k8s.io", "v1beta1", "ingresses"): `{"spec": {"backend": {"serviceName": "service2"}}}`,
|
||||
gvr("networking.k8s.io", "v1", "ingresses"): `{"spec": {"defaultBackend": {"service": {"name": "service2"}}}}`,
|
||||
|
@ -28,7 +28,7 @@ import (
|
||||
"github.com/prometheus/common/expfmt"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
@ -235,7 +235,7 @@ func getRequestCountOfPriorityLevel(c clientset.Interface) (map[string]int, map[
|
||||
}
|
||||
|
||||
func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, username string, concurrencyShares, queuelength int) (*flowcontrol.PriorityLevelConfiguration, *flowcontrol.FlowSchema, error) {
|
||||
pl, err := c.FlowcontrolV1beta1().PriorityLevelConfigurations().Create(context.Background(), &flowcontrol.PriorityLevelConfiguration{
|
||||
pl, err := c.FlowcontrolV1beta2().PriorityLevelConfigurations().Create(context.Background(), &flowcontrol.PriorityLevelConfiguration{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: username,
|
||||
},
|
||||
@ -257,7 +257,7 @@ func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, usern
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
fs, err := c.FlowcontrolV1beta1().FlowSchemas().Create(context.TODO(), &flowcontrol.FlowSchema{
|
||||
fs, err := c.FlowcontrolV1beta2().FlowSchemas().Create(context.TODO(), &flowcontrol.FlowSchema{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: username,
|
||||
},
|
||||
@ -297,7 +297,7 @@ func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, usern
|
||||
}
|
||||
|
||||
return pl, fs, wait.Poll(time.Second, timeout, func() (bool, error) {
|
||||
fs, err := c.FlowcontrolV1beta1().FlowSchemas().Get(context.TODO(), username, metav1.GetOptions{})
|
||||
fs, err := c.FlowcontrolV1beta2().FlowSchemas().Get(context.TODO(), username, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/util/clock"
|
||||
genericfeatures "k8s.io/apiserver/pkg/features"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
@ -95,7 +95,7 @@ func (ft *fightTest) createMainInformer() {
|
||||
myConfig = rest.AddUserAgent(myConfig, "audience")
|
||||
myClientset := clientset.NewForConfigOrDie(myConfig)
|
||||
informerFactory := informers.NewSharedInformerFactory(myClientset, 0)
|
||||
inf := informerFactory.Flowcontrol().V1beta1().FlowSchemas().Informer()
|
||||
inf := informerFactory.Flowcontrol().V1beta2().FlowSchemas().Informer()
|
||||
inf.AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||
AddFunc: func(obj interface{}) {
|
||||
fs := obj.(*flowcontrol.FlowSchema)
|
||||
@ -123,7 +123,7 @@ func (ft *fightTest) createController(invert bool, i int) {
|
||||
myConfig := rest.CopyConfig(ft.loopbackConfig)
|
||||
myConfig = rest.AddUserAgent(myConfig, fieldMgr)
|
||||
myClientset := clientset.NewForConfigOrDie(myConfig)
|
||||
fcIfc := myClientset.FlowcontrolV1beta1()
|
||||
fcIfc := myClientset.FlowcontrolV1beta2()
|
||||
informerFactory := informers.NewSharedInformerFactory(myClientset, 0)
|
||||
foundToDangling := func(found bool) bool { return !found }
|
||||
if invert {
|
||||
|
@ -141,6 +141,7 @@ func TestServerSidePrint(t *testing.T) {
|
||||
{Group: "node.k8s.io", Version: "v1beta1"},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"},
|
||||
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2"},
|
||||
{Group: "internal.apiserver.k8s.io", Version: "v1alpha1"},
|
||||
},
|
||||
[]schema.GroupVersionResource{},
|
||||
|
@ -283,6 +283,22 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
|
||||
},
|
||||
// --
|
||||
|
||||
// k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "flowschemas"): {
|
||||
Stub: `{"metadata": {"name": "fs-1"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
|
||||
ExpectedEtcdPath: "/registry/flowschemas/fs-1",
|
||||
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta1", "FlowSchema"),
|
||||
},
|
||||
// --
|
||||
|
||||
// k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta2
|
||||
gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "prioritylevelconfigurations"): {
|
||||
Stub: `{"metadata": {"name": "conf3"}, "spec": {"type": "Limited", "limited": {"assuredConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
|
||||
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf3",
|
||||
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta1", "PriorityLevelConfiguration"),
|
||||
},
|
||||
// --
|
||||
|
||||
// k8s.io/kubernetes/pkg/apis/storage/v1
|
||||
gvr("storage.k8s.io", "v1", "volumeattachments"): {
|
||||
Stub: `{"metadata": {"name": "va3"}, "spec": {"attacher": "gce", "nodeName": "localhost", "source": {"persistentVolumeName": "pv3"}}}`,
|
||||
|
@ -199,7 +199,7 @@ func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer
|
||||
if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) {
|
||||
controlPlaneConfig.GenericConfig.FlowControl = utilflowcontrol.New(
|
||||
controlPlaneConfig.ExtraConfig.VersionedInformers,
|
||||
clientset.FlowcontrolV1beta1(),
|
||||
clientset.FlowcontrolV1beta2(),
|
||||
controlPlaneConfig.GenericConfig.MaxRequestsInFlight+controlPlaneConfig.GenericConfig.MaxMutatingRequestsInFlight,
|
||||
controlPlaneConfig.GenericConfig.RequestTimeout/4,
|
||||
)
|
||||
|
6
vendor/modules.txt
vendored
6
vendor/modules.txt
vendored
@ -1296,6 +1296,7 @@ k8s.io/api/events/v1beta1
|
||||
k8s.io/api/extensions/v1beta1
|
||||
k8s.io/api/flowcontrol/v1alpha1
|
||||
k8s.io/api/flowcontrol/v1beta1
|
||||
k8s.io/api/flowcontrol/v1beta2
|
||||
k8s.io/api/imagepolicy/v1alpha1
|
||||
k8s.io/api/networking/v1
|
||||
k8s.io/api/networking/v1beta1
|
||||
@ -1611,6 +1612,7 @@ k8s.io/client-go/applyconfigurations/events/v1beta1
|
||||
k8s.io/client-go/applyconfigurations/extensions/v1beta1
|
||||
k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1
|
||||
k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1
|
||||
k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2
|
||||
k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1
|
||||
k8s.io/client-go/applyconfigurations/internal
|
||||
k8s.io/client-go/applyconfigurations/meta/v1
|
||||
@ -1675,6 +1677,7 @@ k8s.io/client-go/informers/extensions/v1beta1
|
||||
k8s.io/client-go/informers/flowcontrol
|
||||
k8s.io/client-go/informers/flowcontrol/v1alpha1
|
||||
k8s.io/client-go/informers/flowcontrol/v1beta1
|
||||
k8s.io/client-go/informers/flowcontrol/v1beta2
|
||||
k8s.io/client-go/informers/internalinterfaces
|
||||
k8s.io/client-go/informers/networking
|
||||
k8s.io/client-go/informers/networking/v1
|
||||
@ -1755,6 +1758,8 @@ k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1
|
||||
k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake
|
||||
k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1
|
||||
k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake
|
||||
k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2
|
||||
k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake
|
||||
k8s.io/client-go/kubernetes/typed/networking/v1
|
||||
k8s.io/client-go/kubernetes/typed/networking/v1/fake
|
||||
k8s.io/client-go/kubernetes/typed/networking/v1beta1
|
||||
@ -1810,6 +1815,7 @@ k8s.io/client-go/listers/events/v1beta1
|
||||
k8s.io/client-go/listers/extensions/v1beta1
|
||||
k8s.io/client-go/listers/flowcontrol/v1alpha1
|
||||
k8s.io/client-go/listers/flowcontrol/v1beta1
|
||||
k8s.io/client-go/listers/flowcontrol/v1beta2
|
||||
k8s.io/client-go/listers/networking/v1
|
||||
k8s.io/client-go/listers/networking/v1beta1
|
||||
k8s.io/client-go/listers/node/v1
|
||||
|
Loading…
Reference in New Issue
Block a user