diff --git a/apiextensions/informers/factory.go b/apiextensions/informers/factory.go index ddbf7e793..c2e4db4b1 100644 --- a/apiextensions/informers/factory.go +++ b/apiextensions/informers/factory.go @@ -46,6 +46,7 @@ type SharedInformerOption func(*SharedInformerOptions) *SharedInformerOptions type SharedInformerOptions struct { customResync map[reflect.Type]time.Duration tweakListOptions internalinterfaces.TweakListOptionsFunc + transform cache.TransformFunc } type sharedInformerFactory struct { @@ -54,6 +55,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]kcpcache.ScopeableSharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -84,6 +86,14 @@ func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFu } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(opts *SharedInformerOptions) *SharedInformerOptions { + opts.transform = transform + return opts + } +} + // NewSharedInformerFactory constructs a new instance of SharedInformerFactory for all namespaces. func NewSharedInformerFactory(client clientset.ClusterInterface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -111,6 +121,7 @@ func NewSharedInformerFactoryWithOptions(client clientset.ClusterInterface, defa // Forward options to the factory factory.customResync = opts.customResync factory.tweakListOptions = opts.tweakListOptions + factory.transform = opts.transform return factory } diff --git a/informers/admissionregistration/v1/interface.go b/informers/admissionregistration/v1/interface.go index 9ca728c5f..84c7c6e73 100644 --- a/informers/admissionregistration/v1/interface.go +++ b/informers/admissionregistration/v1/interface.go @@ -26,6 +26,10 @@ import ( ) type ClusterInterface interface { + // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyClusterInformer + ValidatingAdmissionPolicies() ValidatingAdmissionPolicyClusterInformer + // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingClusterInformer + ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingClusterInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationClusterInformer ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClusterInformer // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationClusterInformer @@ -42,6 +46,16 @@ func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalin return &version{factory: f, tweakListOptions: tweakListOptions} } +// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyClusterInformer +func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyClusterInformer { + return &validatingAdmissionPolicyClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingClusterInformer +func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingClusterInformer { + return &validatingAdmissionPolicyBindingClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationClusterInformer func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClusterInformer { return &validatingWebhookConfigurationClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/informers/admissionregistration/v1/validatingadmissionpolicy.go b/informers/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..6362e7b2a --- /dev/null +++ b/informers/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,124 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + upstreamadmissionregistrationv1informers "k8s.io/client-go/informers/admissionregistration/v1" + upstreamadmissionregistrationv1listers "k8s.io/client-go/listers/admissionregistration/v1" + "k8s.io/client-go/tools/cache" + + "github.com/kcp-dev/client-go/informers/internalinterfaces" + clientset "github.com/kcp-dev/client-go/kubernetes" + admissionregistrationv1listers "github.com/kcp-dev/client-go/listers/admissionregistration/v1" +) + +// ValidatingAdmissionPolicyClusterInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicies. +type ValidatingAdmissionPolicyClusterInformer interface { + Cluster(logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingAdmissionPolicyInformer + Informer() kcpcache.ScopeableSharedIndexInformer + Lister() admissionregistrationv1listers.ValidatingAdmissionPolicyClusterLister +} + +type validatingAdmissionPolicyClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewValidatingAdmissionPolicyClusterInformer constructs a new informer for ValidatingAdmissionPolicy 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 NewValidatingAdmissionPolicyClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredValidatingAdmissionPolicyClusterInformer constructs a new informer for ValidatingAdmissionPolicy 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 NewFilteredValidatingAdmissionPolicyClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { + return kcpinformers.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) + }, + }, + &admissionregistrationv1.ValidatingAdmissionPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *validatingAdmissionPolicyClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyClusterInformer(client, resyncPeriod, cache.Indexers{ + kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, + }, + f.tweakListOptions, + ) +} + +func (f *validatingAdmissionPolicyClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer) +} + +func (f *validatingAdmissionPolicyClusterInformer) Lister() admissionregistrationv1listers.ValidatingAdmissionPolicyClusterLister { + return admissionregistrationv1listers.NewValidatingAdmissionPolicyClusterLister(f.Informer().GetIndexer()) +} + +func (f *validatingAdmissionPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingAdmissionPolicyInformer { + return &validatingAdmissionPolicyInformer{ + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), + } +} + +type validatingAdmissionPolicyInformer struct { + informer cache.SharedIndexInformer + lister upstreamadmissionregistrationv1listers.ValidatingAdmissionPolicyLister +} + +func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +func (f *validatingAdmissionPolicyInformer) Lister() upstreamadmissionregistrationv1listers.ValidatingAdmissionPolicyLister { + return f.lister +} diff --git a/informers/admissionregistration/v1/validatingadmissionpolicybinding.go b/informers/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..024947cd7 --- /dev/null +++ b/informers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,124 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + upstreamadmissionregistrationv1informers "k8s.io/client-go/informers/admissionregistration/v1" + upstreamadmissionregistrationv1listers "k8s.io/client-go/listers/admissionregistration/v1" + "k8s.io/client-go/tools/cache" + + "github.com/kcp-dev/client-go/informers/internalinterfaces" + clientset "github.com/kcp-dev/client-go/kubernetes" + admissionregistrationv1listers "github.com/kcp-dev/client-go/listers/admissionregistration/v1" +) + +// ValidatingAdmissionPolicyBindingClusterInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicyBindings. +type ValidatingAdmissionPolicyBindingClusterInformer interface { + Cluster(logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingAdmissionPolicyBindingInformer + Informer() kcpcache.ScopeableSharedIndexInformer + Lister() admissionregistrationv1listers.ValidatingAdmissionPolicyBindingClusterLister +} + +type validatingAdmissionPolicyBindingClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewValidatingAdmissionPolicyBindingClusterInformer constructs a new informer for ValidatingAdmissionPolicyBinding 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 NewValidatingAdmissionPolicyBindingClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyBindingClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredValidatingAdmissionPolicyBindingClusterInformer constructs a new informer for ValidatingAdmissionPolicyBinding 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 NewFilteredValidatingAdmissionPolicyBindingClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { + return kcpinformers.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) + }, + }, + &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, + resyncPeriod, + indexers, + ) +} + +func (f *validatingAdmissionPolicyBindingClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyBindingClusterInformer(client, resyncPeriod, cache.Indexers{ + kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, + }, + f.tweakListOptions, + ) +} + +func (f *validatingAdmissionPolicyBindingClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) +} + +func (f *validatingAdmissionPolicyBindingClusterInformer) Lister() admissionregistrationv1listers.ValidatingAdmissionPolicyBindingClusterLister { + return admissionregistrationv1listers.NewValidatingAdmissionPolicyBindingClusterLister(f.Informer().GetIndexer()) +} + +func (f *validatingAdmissionPolicyBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingAdmissionPolicyBindingInformer { + return &validatingAdmissionPolicyBindingInformer{ + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), + } +} + +type validatingAdmissionPolicyBindingInformer struct { + informer cache.SharedIndexInformer + lister upstreamadmissionregistrationv1listers.ValidatingAdmissionPolicyBindingLister +} + +func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +func (f *validatingAdmissionPolicyBindingInformer) Lister() upstreamadmissionregistrationv1listers.ValidatingAdmissionPolicyBindingLister { + return f.lister +} diff --git a/informers/factory.go b/informers/factory.go index ecd38edec..5e214cde7 100644 --- a/informers/factory.go +++ b/informers/factory.go @@ -55,6 +55,7 @@ import ( resourceinformers "github.com/kcp-dev/client-go/informers/resource" schedulinginformers "github.com/kcp-dev/client-go/informers/scheduling" storageinformers "github.com/kcp-dev/client-go/informers/storage" + storagemigrationinformers "github.com/kcp-dev/client-go/informers/storagemigration" clientset "github.com/kcp-dev/client-go/kubernetes" ) @@ -64,6 +65,7 @@ type SharedInformerOption func(*SharedInformerOptions) *SharedInformerOptions type SharedInformerOptions struct { customResync map[reflect.Type]time.Duration tweakListOptions internalinterfaces.TweakListOptionsFunc + transform cache.TransformFunc } type sharedInformerFactory struct { @@ -72,6 +74,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]kcpcache.ScopeableSharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -102,6 +105,14 @@ func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFu } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(opts *SharedInformerOptions) *SharedInformerOptions { + opts.transform = transform + return opts + } +} + // NewSharedInformerFactory constructs a new instance of SharedInformerFactory for all namespaces. func NewSharedInformerFactory(client clientset.ClusterInterface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -129,6 +140,7 @@ func NewSharedInformerFactoryWithOptions(client clientset.ClusterInterface, defa // Forward options to the factory factory.customResync = opts.customResync factory.tweakListOptions = opts.tweakListOptions + factory.transform = opts.transform return factory } @@ -294,6 +306,7 @@ type SharedInformerFactory interface { Resource() resourceinformers.ClusterInterface Scheduling() schedulinginformers.ClusterInterface Storage() storageinformers.ClusterInterface + Storagemigration() storagemigrationinformers.ClusterInterface } func (f *sharedInformerFactory) Admissionregistration() admissionregistrationinformers.ClusterInterface { @@ -372,6 +385,10 @@ func (f *sharedInformerFactory) Storage() storageinformers.ClusterInterface { return storageinformers.New(f, f.tweakListOptions) } +func (f *sharedInformerFactory) Storagemigration() storagemigrationinformers.ClusterInterface { + return storagemigrationinformers.New(f, f.tweakListOptions) +} + func (f *sharedInformerFactory) Cluster(clusterName logicalcluster.Name) ScopedDynamicSharedInformerFactory { return &scopedDynamicSharedInformerFactory{ sharedInformerFactory: f, diff --git a/informers/flowcontrol/interface.go b/informers/flowcontrol/interface.go index 7536ea286..407139e2a 100644 --- a/informers/flowcontrol/interface.go +++ b/informers/flowcontrol/interface.go @@ -22,7 +22,7 @@ limitations under the License. package flowcontrol import ( - "github.com/kcp-dev/client-go/informers/flowcontrol/v1alpha1" + "github.com/kcp-dev/client-go/informers/flowcontrol/v1" "github.com/kcp-dev/client-go/informers/flowcontrol/v1beta1" "github.com/kcp-dev/client-go/informers/flowcontrol/v1beta2" "github.com/kcp-dev/client-go/informers/flowcontrol/v1beta3" @@ -30,8 +30,8 @@ import ( ) type ClusterInterface interface { - // V1alpha1 provides access to the shared informers in V1alpha1. - V1alpha1() v1alpha1.ClusterInterface + // V1 provides access to the shared informers in V1. + V1() v1.ClusterInterface // V1beta1 provides access to the shared informers in V1beta1. V1beta1() v1beta1.ClusterInterface // V1beta2 provides access to the shared informers in V1beta2. @@ -50,9 +50,9 @@ func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalin return &group{factory: f, tweakListOptions: tweakListOptions} } -// V1alpha1 returns a new v1alpha1.ClusterInterface. -func (g *group) V1alpha1() v1alpha1.ClusterInterface { - return v1alpha1.New(g.factory, g.tweakListOptions) +// V1 returns a new v1.ClusterInterface. +func (g *group) V1() v1.ClusterInterface { + return v1.New(g.factory, g.tweakListOptions) } // V1beta1 returns a new v1beta1.ClusterInterface. diff --git a/informers/flowcontrol/v1alpha1/flowschema.go b/informers/flowcontrol/v1/flowschema.go similarity index 75% rename from informers/flowcontrol/v1alpha1/flowschema.go rename to informers/flowcontrol/v1/flowschema.go index df538fa02..20bbde5cd 100644 --- a/informers/flowcontrol/v1alpha1/flowschema.go +++ b/informers/flowcontrol/v1/flowschema.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "context" @@ -29,25 +29,25 @@ import ( kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" - upstreamflowcontrolv1alpha1informers "k8s.io/client-go/informers/flowcontrol/v1alpha1" - upstreamflowcontrolv1alpha1listers "k8s.io/client-go/listers/flowcontrol/v1alpha1" + upstreamflowcontrolv1informers "k8s.io/client-go/informers/flowcontrol/v1" + upstreamflowcontrolv1listers "k8s.io/client-go/listers/flowcontrol/v1" "k8s.io/client-go/tools/cache" "github.com/kcp-dev/client-go/informers/internalinterfaces" clientset "github.com/kcp-dev/client-go/kubernetes" - flowcontrolv1alpha1listers "github.com/kcp-dev/client-go/listers/flowcontrol/v1alpha1" + flowcontrolv1listers "github.com/kcp-dev/client-go/listers/flowcontrol/v1" ) // FlowSchemaClusterInformer provides access to a shared informer and lister for // FlowSchemas. type FlowSchemaClusterInformer interface { - Cluster(logicalcluster.Name) upstreamflowcontrolv1alpha1informers.FlowSchemaInformer + Cluster(logicalcluster.Name) upstreamflowcontrolv1informers.FlowSchemaInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() flowcontrolv1alpha1listers.FlowSchemaClusterLister + Lister() flowcontrolv1listers.FlowSchemaClusterLister } type flowSchemaClusterInformer struct { @@ -72,16 +72,16 @@ func NewFilteredFlowSchemaClusterInformer(client clientset.ClusterInterface, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) }, }, - &flowcontrolv1alpha1.FlowSchema{}, + &flowcontrolv1.FlowSchema{}, resyncPeriod, indexers, ) @@ -96,14 +96,14 @@ func (f *flowSchemaClusterInformer) defaultInformer(client clientset.ClusterInte } func (f *flowSchemaClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1alpha1.FlowSchema{}, f.defaultInformer) + return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer) } -func (f *flowSchemaClusterInformer) Lister() flowcontrolv1alpha1listers.FlowSchemaClusterLister { - return flowcontrolv1alpha1listers.NewFlowSchemaClusterLister(f.Informer().GetIndexer()) +func (f *flowSchemaClusterInformer) Lister() flowcontrolv1listers.FlowSchemaClusterLister { + return flowcontrolv1listers.NewFlowSchemaClusterLister(f.Informer().GetIndexer()) } -func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1alpha1informers.FlowSchemaInformer { +func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1informers.FlowSchemaInformer { return &flowSchemaInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), @@ -112,13 +112,13 @@ func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) ups type flowSchemaInformer struct { informer cache.SharedIndexInformer - lister upstreamflowcontrolv1alpha1listers.FlowSchemaLister + lister upstreamflowcontrolv1listers.FlowSchemaLister } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *flowSchemaInformer) Lister() upstreamflowcontrolv1alpha1listers.FlowSchemaLister { +func (f *flowSchemaInformer) Lister() upstreamflowcontrolv1listers.FlowSchemaLister { return f.lister } diff --git a/informers/flowcontrol/v1alpha1/interface.go b/informers/flowcontrol/v1/interface.go similarity index 99% rename from informers/flowcontrol/v1alpha1/interface.go rename to informers/flowcontrol/v1/interface.go index 91567e452..9a939406d 100644 --- a/informers/flowcontrol/v1alpha1/interface.go +++ b/informers/flowcontrol/v1/interface.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "github.com/kcp-dev/client-go/informers/internalinterfaces" diff --git a/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/informers/flowcontrol/v1/prioritylevelconfiguration.go similarity index 76% rename from informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go rename to informers/flowcontrol/v1/prioritylevelconfiguration.go index 3840ce1fd..0903cb046 100644 --- a/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/informers/flowcontrol/v1/prioritylevelconfiguration.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "context" @@ -29,25 +29,25 @@ import ( kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" - upstreamflowcontrolv1alpha1informers "k8s.io/client-go/informers/flowcontrol/v1alpha1" - upstreamflowcontrolv1alpha1listers "k8s.io/client-go/listers/flowcontrol/v1alpha1" + upstreamflowcontrolv1informers "k8s.io/client-go/informers/flowcontrol/v1" + upstreamflowcontrolv1listers "k8s.io/client-go/listers/flowcontrol/v1" "k8s.io/client-go/tools/cache" "github.com/kcp-dev/client-go/informers/internalinterfaces" clientset "github.com/kcp-dev/client-go/kubernetes" - flowcontrolv1alpha1listers "github.com/kcp-dev/client-go/listers/flowcontrol/v1alpha1" + flowcontrolv1listers "github.com/kcp-dev/client-go/listers/flowcontrol/v1" ) // PriorityLevelConfigurationClusterInformer provides access to a shared informer and lister for // PriorityLevelConfigurations. type PriorityLevelConfigurationClusterInformer interface { - Cluster(logicalcluster.Name) upstreamflowcontrolv1alpha1informers.PriorityLevelConfigurationInformer + Cluster(logicalcluster.Name) upstreamflowcontrolv1informers.PriorityLevelConfigurationInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() flowcontrolv1alpha1listers.PriorityLevelConfigurationClusterLister + Lister() flowcontrolv1listers.PriorityLevelConfigurationClusterLister } type priorityLevelConfigurationClusterInformer struct { @@ -72,16 +72,16 @@ func NewFilteredPriorityLevelConfigurationClusterInformer(client clientset.Clust if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, - &flowcontrolv1alpha1.PriorityLevelConfiguration{}, + &flowcontrolv1.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) @@ -96,14 +96,14 @@ func (f *priorityLevelConfigurationClusterInformer) defaultInformer(client clien } func (f *priorityLevelConfigurationClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1alpha1.PriorityLevelConfiguration{}, f.defaultInformer) + return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) } -func (f *priorityLevelConfigurationClusterInformer) Lister() flowcontrolv1alpha1listers.PriorityLevelConfigurationClusterLister { - return flowcontrolv1alpha1listers.NewPriorityLevelConfigurationClusterLister(f.Informer().GetIndexer()) +func (f *priorityLevelConfigurationClusterInformer) Lister() flowcontrolv1listers.PriorityLevelConfigurationClusterLister { + return flowcontrolv1listers.NewPriorityLevelConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1alpha1informers.PriorityLevelConfigurationInformer { +func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1informers.PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), @@ -112,13 +112,13 @@ func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalc type priorityLevelConfigurationInformer struct { informer cache.SharedIndexInformer - lister upstreamflowcontrolv1alpha1listers.PriorityLevelConfigurationLister + lister upstreamflowcontrolv1listers.PriorityLevelConfigurationLister } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *priorityLevelConfigurationInformer) Lister() upstreamflowcontrolv1alpha1listers.PriorityLevelConfigurationLister { +func (f *priorityLevelConfigurationInformer) Lister() upstreamflowcontrolv1listers.PriorityLevelConfigurationLister { return f.lister } diff --git a/informers/generic.go b/informers/generic.go index e32708993..b1784eb05 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -51,7 +51,7 @@ import ( eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" @@ -73,6 +73,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" "k8s.io/apimachinery/pkg/runtime/schema" upstreaminformers "k8s.io/client-go/informers" "k8s.io/client-go/tools/cache" @@ -127,6 +128,10 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericClusterInformer, error) { switch resource { // Group=admissionregistration.k8s.io, Version=V1 + case admissionregistrationv1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicies().Informer()}, nil + case admissionregistrationv1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicyBindings().Informer()}, nil case admissionregistrationv1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingWebhookConfigurations().Informer()}, nil case admissionregistrationv1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): @@ -265,11 +270,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil case extensionsv1beta1.SchemeGroupVersion.WithResource("networkpolicies"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().NetworkPolicies().Informer()}, nil - // Group=flowcontrol.apiserver.k8s.io, Version=V1alpha1 - case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("flowschemas"): - return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().FlowSchemas().Informer()}, nil - case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): - return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().PriorityLevelConfigurations().Informer()}, nil + // Group=flowcontrol.apiserver.k8s.io, Version=V1 + case flowcontrolv1.SchemeGroupVersion.WithResource("flowschemas"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().FlowSchemas().Informer()}, nil + case flowcontrolv1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().PriorityLevelConfigurations().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=V1beta1 case flowcontrolv1beta1.SchemeGroupVersion.WithResource("flowschemas"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta1().FlowSchemas().Informer()}, nil @@ -296,10 +301,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case networkingv1.SchemeGroupVersion.WithResource("ingressclasses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Networking().V1().IngressClasses().Informer()}, nil // Group=networking.k8s.io, Version=V1alpha1 - case networkingv1alpha1.SchemeGroupVersion.WithResource("clustercidrs"): - return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ClusterCIDRs().Informer()}, nil case networkingv1alpha1.SchemeGroupVersion.WithResource("ipaddresses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().IPAddresses().Informer()}, nil + case networkingv1alpha1.SchemeGroupVersion.WithResource("servicecidrs"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ServiceCIDRs().Informer()}, nil // Group=networking.k8s.io, Version=V1beta1 case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Ingresses().Informer()}, nil @@ -320,8 +325,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=policy, Version=V1beta1 case policyv1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil - case policyv1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): - return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=V1 case rbacv1.SchemeGroupVersion.WithResource("roles"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().Roles().Informer()}, nil @@ -358,6 +361,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClasses().Informer()}, nil case resourcev1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimTemplates().Informer()}, nil + case resourcev1alpha2.SchemeGroupVersion.WithResource("resourceslices"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceSlices().Informer()}, nil + case resourcev1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimParameters().Informer()}, nil + case resourcev1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClassParameters().Informer()}, nil // Group=scheduling.k8s.io, Version=V1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil @@ -367,6 +376,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=scheduling.k8s.io, Version=V1beta1 case schedulingv1beta1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().PriorityClasses().Informer()}, nil + // Group=storagemigration.k8s.io, Version=V1alpha1 + case storagemigrationv1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1alpha1().StorageVersionMigrations().Informer()}, nil // Group=storage.k8s.io, Version=V1 case storagev1.SchemeGroupVersion.WithResource("storageclasses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil @@ -383,6 +395,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttachments().Informer()}, nil case storagev1alpha1.SchemeGroupVersion.WithResource("csistoragecapacities"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().CSIStorageCapacities().Informer()}, nil + case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses"): + return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttributesClasses().Informer()}, nil // Group=storage.k8s.io, Version=V1beta1 case storagev1beta1.SchemeGroupVersion.WithResource("storageclasses"): return &genericClusterInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil diff --git a/informers/networking/v1alpha1/interface.go b/informers/networking/v1alpha1/interface.go index 8404785ce..4f83f8c01 100644 --- a/informers/networking/v1alpha1/interface.go +++ b/informers/networking/v1alpha1/interface.go @@ -26,10 +26,10 @@ import ( ) type ClusterInterface interface { - // ClusterCIDRs returns a ClusterCIDRClusterInformer - ClusterCIDRs() ClusterCIDRClusterInformer // IPAddresses returns a IPAddressClusterInformer IPAddresses() IPAddressClusterInformer + // ServiceCIDRs returns a ServiceCIDRClusterInformer + ServiceCIDRs() ServiceCIDRClusterInformer } type version struct { @@ -42,12 +42,12 @@ func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalin return &version{factory: f, tweakListOptions: tweakListOptions} } -// ClusterCIDRs returns a ClusterCIDRClusterInformer -func (v *version) ClusterCIDRs() ClusterCIDRClusterInformer { - return &clusterCIDRClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // IPAddresses returns a IPAddressClusterInformer func (v *version) IPAddresses() IPAddressClusterInformer { return &iPAddressClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ServiceCIDRs returns a ServiceCIDRClusterInformer +func (v *version) ServiceCIDRs() ServiceCIDRClusterInformer { + return &serviceCIDRClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/networking/v1alpha1/clustercidr.go b/informers/networking/v1alpha1/servicecidr.go similarity index 67% rename from informers/networking/v1alpha1/clustercidr.go rename to informers/networking/v1alpha1/servicecidr.go index a540326d1..ae1c0be07 100644 --- a/informers/networking/v1alpha1/clustercidr.go +++ b/informers/networking/v1alpha1/servicecidr.go @@ -42,83 +42,83 @@ import ( networkingv1alpha1listers "github.com/kcp-dev/client-go/listers/networking/v1alpha1" ) -// ClusterCIDRClusterInformer provides access to a shared informer and lister for -// ClusterCIDRs. -type ClusterCIDRClusterInformer interface { - Cluster(logicalcluster.Name) upstreamnetworkingv1alpha1informers.ClusterCIDRInformer +// ServiceCIDRClusterInformer provides access to a shared informer and lister for +// ServiceCIDRs. +type ServiceCIDRClusterInformer interface { + Cluster(logicalcluster.Name) upstreamnetworkingv1alpha1informers.ServiceCIDRInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() networkingv1alpha1listers.ClusterCIDRClusterLister + Lister() networkingv1alpha1listers.ServiceCIDRClusterLister } -type clusterCIDRClusterInformer struct { +type serviceCIDRClusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewClusterCIDRClusterInformer constructs a new informer for ClusterCIDR type. +// NewServiceCIDRClusterInformer constructs a new informer for ServiceCIDR 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 NewClusterCIDRClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredClusterCIDRClusterInformer(client, resyncPeriod, indexers, nil) +func NewServiceCIDRClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredServiceCIDRClusterInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredClusterCIDRClusterInformer constructs a new informer for ClusterCIDR type. +// NewFilteredServiceCIDRClusterInformer constructs a new informer for ServiceCIDR 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 NewFilteredClusterCIDRClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { +func NewFilteredServiceCIDRClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { return kcpinformers.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ClusterCIDRs().List(context.TODO(), options) + return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ClusterCIDRs().Watch(context.TODO(), options) + return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options) }, }, - &networkingv1alpha1.ClusterCIDR{}, + &networkingv1alpha1.ServiceCIDR{}, resyncPeriod, indexers, ) } -func (f *clusterCIDRClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredClusterCIDRClusterInformer(client, resyncPeriod, cache.Indexers{ +func (f *serviceCIDRClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredServiceCIDRClusterInformer(client, resyncPeriod, cache.Indexers{ kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, }, f.tweakListOptions, ) } -func (f *clusterCIDRClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&networkingv1alpha1.ClusterCIDR{}, f.defaultInformer) +func (f *serviceCIDRClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&networkingv1alpha1.ServiceCIDR{}, f.defaultInformer) } -func (f *clusterCIDRClusterInformer) Lister() networkingv1alpha1listers.ClusterCIDRClusterLister { - return networkingv1alpha1listers.NewClusterCIDRClusterLister(f.Informer().GetIndexer()) +func (f *serviceCIDRClusterInformer) Lister() networkingv1alpha1listers.ServiceCIDRClusterLister { + return networkingv1alpha1listers.NewServiceCIDRClusterLister(f.Informer().GetIndexer()) } -func (f *clusterCIDRClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1alpha1informers.ClusterCIDRInformer { - return &clusterCIDRInformer{ +func (f *serviceCIDRClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1alpha1informers.ServiceCIDRInformer { + return &serviceCIDRInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), } } -type clusterCIDRInformer struct { +type serviceCIDRInformer struct { informer cache.SharedIndexInformer - lister upstreamnetworkingv1alpha1listers.ClusterCIDRLister + lister upstreamnetworkingv1alpha1listers.ServiceCIDRLister } -func (f *clusterCIDRInformer) Informer() cache.SharedIndexInformer { +func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *clusterCIDRInformer) Lister() upstreamnetworkingv1alpha1listers.ClusterCIDRLister { +func (f *serviceCIDRInformer) Lister() upstreamnetworkingv1alpha1listers.ServiceCIDRLister { return f.lister } diff --git a/informers/policy/v1beta1/interface.go b/informers/policy/v1beta1/interface.go index 9a896b73e..61164a191 100644 --- a/informers/policy/v1beta1/interface.go +++ b/informers/policy/v1beta1/interface.go @@ -28,8 +28,6 @@ import ( type ClusterInterface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetClusterInformer PodDisruptionBudgets() PodDisruptionBudgetClusterInformer - // PodSecurityPolicies returns a PodSecurityPolicyClusterInformer - PodSecurityPolicies() PodSecurityPolicyClusterInformer } type version struct { @@ -46,8 +44,3 @@ func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalin func (v *version) PodDisruptionBudgets() PodDisruptionBudgetClusterInformer { return &podDisruptionBudgetClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } - -// PodSecurityPolicies returns a PodSecurityPolicyClusterInformer -func (v *version) PodSecurityPolicies() PodSecurityPolicyClusterInformer { - return &podSecurityPolicyClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/informers/policy/v1beta1/podsecuritypolicy.go b/informers/policy/v1beta1/podsecuritypolicy.go deleted file mode 100644 index 875f50533..000000000 --- a/informers/policy/v1beta1/podsecuritypolicy.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" - "github.com/kcp-dev/logicalcluster/v3" - - policyv1beta1 "k8s.io/api/policy/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - upstreampolicyv1beta1informers "k8s.io/client-go/informers/policy/v1beta1" - upstreampolicyv1beta1listers "k8s.io/client-go/listers/policy/v1beta1" - "k8s.io/client-go/tools/cache" - - "github.com/kcp-dev/client-go/informers/internalinterfaces" - clientset "github.com/kcp-dev/client-go/kubernetes" - policyv1beta1listers "github.com/kcp-dev/client-go/listers/policy/v1beta1" -) - -// PodSecurityPolicyClusterInformer provides access to a shared informer and lister for -// PodSecurityPolicies. -type PodSecurityPolicyClusterInformer interface { - Cluster(logicalcluster.Name) upstreampolicyv1beta1informers.PodSecurityPolicyInformer - Informer() kcpcache.ScopeableSharedIndexInformer - Lister() policyv1beta1listers.PodSecurityPolicyClusterLister -} - -type podSecurityPolicyClusterInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewPodSecurityPolicyClusterInformer constructs a new informer for PodSecurityPolicy 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 NewPodSecurityPolicyClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredPodSecurityPolicyClusterInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredPodSecurityPolicyClusterInformer constructs a new informer for PodSecurityPolicy 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 NewFilteredPodSecurityPolicyClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { - return kcpinformers.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicyV1beta1().PodSecurityPolicies().Watch(context.TODO(), options) - }, - }, - &policyv1beta1.PodSecurityPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *podSecurityPolicyClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredPodSecurityPolicyClusterInformer(client, resyncPeriod, cache.Indexers{ - kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, - }, - f.tweakListOptions, - ) -} - -func (f *podSecurityPolicyClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&policyv1beta1.PodSecurityPolicy{}, f.defaultInformer) -} - -func (f *podSecurityPolicyClusterInformer) Lister() policyv1beta1listers.PodSecurityPolicyClusterLister { - return policyv1beta1listers.NewPodSecurityPolicyClusterLister(f.Informer().GetIndexer()) -} - -func (f *podSecurityPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreampolicyv1beta1informers.PodSecurityPolicyInformer { - return &podSecurityPolicyInformer{ - informer: f.Informer().Cluster(clusterName), - lister: f.Lister().Cluster(clusterName), - } -} - -type podSecurityPolicyInformer struct { - informer cache.SharedIndexInformer - lister upstreampolicyv1beta1listers.PodSecurityPolicyLister -} - -func (f *podSecurityPolicyInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -func (f *podSecurityPolicyInformer) Lister() upstreampolicyv1beta1listers.PodSecurityPolicyLister { - return f.lister -} diff --git a/informers/resource/v1alpha1/interface.go b/informers/resource/v1alpha1/interface.go deleted file mode 100644 index de7a0820f..000000000 --- a/informers/resource/v1alpha1/interface.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/kcp-dev/client-go/informers/internalinterfaces" -) - -type ClusterInterface interface { - // ResourceClaims returns a ResourceClaimClusterInformer - ResourceClaims() ResourceClaimClusterInformer - // PodSchedulings returns a PodSchedulingClusterInformer - PodSchedulings() PodSchedulingClusterInformer - // ResourceClasses returns a ResourceClassClusterInformer - ResourceClasses() ResourceClassClusterInformer - // ResourceClaimTemplates returns a ResourceClaimTemplateClusterInformer - ResourceClaimTemplates() ResourceClaimTemplateClusterInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new ClusterInterface. -func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterInterface { - return &version{factory: f, tweakListOptions: tweakListOptions} -} - -// ResourceClaims returns a ResourceClaimClusterInformer -func (v *version) ResourceClaims() ResourceClaimClusterInformer { - return &resourceClaimClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// PodSchedulings returns a PodSchedulingClusterInformer -func (v *version) PodSchedulings() PodSchedulingClusterInformer { - return &podSchedulingClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// ResourceClasses returns a ResourceClassClusterInformer -func (v *version) ResourceClasses() ResourceClassClusterInformer { - return &resourceClassClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// ResourceClaimTemplates returns a ResourceClaimTemplateClusterInformer -func (v *version) ResourceClaimTemplates() ResourceClaimTemplateClusterInformer { - return &resourceClaimTemplateClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/informers/resource/v1alpha2/interface.go b/informers/resource/v1alpha2/interface.go index ca59b06db..7b2e0ff49 100644 --- a/informers/resource/v1alpha2/interface.go +++ b/informers/resource/v1alpha2/interface.go @@ -34,6 +34,12 @@ type ClusterInterface interface { ResourceClasses() ResourceClassClusterInformer // ResourceClaimTemplates returns a ResourceClaimTemplateClusterInformer ResourceClaimTemplates() ResourceClaimTemplateClusterInformer + // ResourceSlices returns a ResourceSliceClusterInformer + ResourceSlices() ResourceSliceClusterInformer + // ResourceClaimParameters returns a ResourceClaimParametersClusterInformer + ResourceClaimParameters() ResourceClaimParametersClusterInformer + // ResourceClassParameters returns a ResourceClassParametersClusterInformer + ResourceClassParameters() ResourceClassParametersClusterInformer } type version struct { @@ -65,3 +71,18 @@ func (v *version) ResourceClasses() ResourceClassClusterInformer { func (v *version) ResourceClaimTemplates() ResourceClaimTemplateClusterInformer { return &resourceClaimTemplateClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ResourceSlices returns a ResourceSliceClusterInformer +func (v *version) ResourceSlices() ResourceSliceClusterInformer { + return &resourceSliceClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceClaimParameters returns a ResourceClaimParametersClusterInformer +func (v *version) ResourceClaimParameters() ResourceClaimParametersClusterInformer { + return &resourceClaimParametersClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceClassParameters returns a ResourceClassParametersClusterInformer +func (v *version) ResourceClassParameters() ResourceClassParametersClusterInformer { + return &resourceClassParametersClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/resource/v1alpha1/resourceclaim.go b/informers/resource/v1alpha2/resourceclaimparameters.go similarity index 52% rename from informers/resource/v1alpha1/resourceclaim.go rename to informers/resource/v1alpha2/resourceclaimparameters.go index 97ce7e2bb..7d695f4ad 100644 --- a/informers/resource/v1alpha1/resourceclaim.go +++ b/informers/resource/v1alpha2/resourceclaimparameters.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "context" @@ -42,83 +42,83 @@ import ( resourcev1alpha2listers "github.com/kcp-dev/client-go/listers/resource/v1alpha2" ) -// ResourceClaimClusterInformer provides access to a shared informer and lister for -// ResourceClaims. -type ResourceClaimClusterInformer interface { - Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimInformer +// ResourceClaimParametersClusterInformer provides access to a shared informer and lister for +// ResourceClaimParameters. +type ResourceClaimParametersClusterInformer interface { + Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimParametersInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() resourcev1alpha2listers.ResourceClaimClusterLister + Lister() resourcev1alpha2listers.ResourceClaimParametersClusterLister } -type resourceClaimClusterInformer struct { +type resourceClaimParametersClusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewResourceClaimClusterInformer constructs a new informer for ResourceClaim type. +// NewResourceClaimParametersClusterInformer constructs a new informer for ResourceClaimParameters 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 NewResourceClaimClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClaimClusterInformer(client, resyncPeriod, indexers, nil) +func NewResourceClaimParametersClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceClaimParametersClusterInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredResourceClaimClusterInformer constructs a new informer for ResourceClaim type. +// NewFilteredResourceClaimParametersClusterInformer constructs a new informer for ResourceClaimParameters 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 NewFilteredResourceClaimClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { +func NewFilteredResourceClaimParametersClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { return kcpinformers.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims().List(context.TODO(), options) + return client.ResourceV1alpha2().ResourceClaimParameters().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims().Watch(context.TODO(), options) + return client.ResourceV1alpha2().ResourceClaimParameters().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaim{}, + &resourcev1alpha2.ResourceClaimParameters{}, resyncPeriod, indexers, ) } -func (f *resourceClaimClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClaimClusterInformer(client, resyncPeriod, cache.Indexers{ +func (f *resourceClaimParametersClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceClaimParametersClusterInformer(client, resyncPeriod, cache.Indexers{ kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, kcpcache.ClusterAndNamespaceIndexName: kcpcache.ClusterAndNamespaceIndexFunc}, f.tweakListOptions, ) } -func (f *resourceClaimClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaim{}, f.defaultInformer) +func (f *resourceClaimParametersClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimParameters{}, f.defaultInformer) } -func (f *resourceClaimClusterInformer) Lister() resourcev1alpha2listers.ResourceClaimClusterLister { - return resourcev1alpha2listers.NewResourceClaimClusterLister(f.Informer().GetIndexer()) +func (f *resourceClaimParametersClusterInformer) Lister() resourcev1alpha2listers.ResourceClaimParametersClusterLister { + return resourcev1alpha2listers.NewResourceClaimParametersClusterLister(f.Informer().GetIndexer()) } -func (f *resourceClaimClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimInformer { - return &resourceClaimInformer{ +func (f *resourceClaimParametersClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimParametersInformer { + return &resourceClaimParametersInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), } } -type resourceClaimInformer struct { +type resourceClaimParametersInformer struct { informer cache.SharedIndexInformer - lister upstreamresourcev1alpha2listers.ResourceClaimLister + lister upstreamresourcev1alpha2listers.ResourceClaimParametersLister } -func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { +func (f *resourceClaimParametersInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *resourceClaimInformer) Lister() upstreamresourcev1alpha2listers.ResourceClaimLister { +func (f *resourceClaimParametersInformer) Lister() upstreamresourcev1alpha2listers.ResourceClaimParametersLister { return f.lister } diff --git a/informers/resource/v1alpha1/podscheduling.go b/informers/resource/v1alpha2/resourceclassparameters.go similarity index 52% rename from informers/resource/v1alpha1/podscheduling.go rename to informers/resource/v1alpha2/resourceclassparameters.go index f68ba95cc..67a468e18 100644 --- a/informers/resource/v1alpha1/podscheduling.go +++ b/informers/resource/v1alpha2/resourceclassparameters.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "context" @@ -42,83 +42,83 @@ import ( resourcev1alpha2listers "github.com/kcp-dev/client-go/listers/resource/v1alpha2" ) -// PodSchedulingClusterInformer provides access to a shared informer and lister for -// PodSchedulings. -type PodSchedulingClusterInformer interface { - Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.PodSchedulingContextInformer +// ResourceClassParametersClusterInformer provides access to a shared informer and lister for +// ResourceClassParameters. +type ResourceClassParametersClusterInformer interface { + Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClassParametersInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() resourcev1alpha2listers.PodSchedulingContextClusterLister + Lister() resourcev1alpha2listers.ResourceClassParametersClusterLister } -type podSchedulingClusterInformer struct { +type resourceClassParametersClusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewPodSchedulingClusterInformer constructs a new informer for PodScheduling type. +// NewResourceClassParametersClusterInformer constructs a new informer for ResourceClassParameters 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 NewPodSchedulingClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredPodSchedulingClusterInformer(client, resyncPeriod, indexers, nil) +func NewResourceClassParametersClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceClassParametersClusterInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredPodSchedulingClusterInformer constructs a new informer for PodScheduling type. +// NewFilteredResourceClassParametersClusterInformer constructs a new informer for ResourceClassParameters 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 NewFilteredPodSchedulingClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { +func NewFilteredResourceClassParametersClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { return kcpinformers.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts().List(context.TODO(), options) + return client.ResourceV1alpha2().ResourceClassParameters().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts().Watch(context.TODO(), options) + return client.ResourceV1alpha2().ResourceClassParameters().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.PodSchedulingContext{}, + &resourcev1alpha2.ResourceClassParameters{}, resyncPeriod, indexers, ) } -func (f *podSchedulingClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredPodSchedulingClusterInformer(client, resyncPeriod, cache.Indexers{ +func (f *resourceClassParametersClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceClassParametersClusterInformer(client, resyncPeriod, cache.Indexers{ kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, kcpcache.ClusterAndNamespaceIndexName: kcpcache.ClusterAndNamespaceIndexFunc}, f.tweakListOptions, ) } -func (f *podSchedulingClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.PodSchedulingContext{}, f.defaultInformer) +func (f *resourceClassParametersClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha2.ResourceClassParameters{}, f.defaultInformer) } -func (f *podSchedulingClusterInformer) Lister() resourcev1alpha2listers.PodSchedulingContextClusterLister { - return resourcev1alpha2listers.NewPodSchedulingContextClusterLister(f.Informer().GetIndexer()) +func (f *resourceClassParametersClusterInformer) Lister() resourcev1alpha2listers.ResourceClassParametersClusterLister { + return resourcev1alpha2listers.NewResourceClassParametersClusterLister(f.Informer().GetIndexer()) } -func (f *podSchedulingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.PodSchedulingContextInformer { - return &podSchedulingInformer{ +func (f *resourceClassParametersClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClassParametersInformer { + return &resourceClassParametersInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), } } -type podSchedulingInformer struct { +type resourceClassParametersInformer struct { informer cache.SharedIndexInformer - lister upstreamresourcev1alpha2listers.PodSchedulingContextLister + lister upstreamresourcev1alpha2listers.ResourceClassParametersLister } -func (f *podSchedulingInformer) Informer() cache.SharedIndexInformer { +func (f *resourceClassParametersInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *podSchedulingInformer) Lister() upstreamresourcev1alpha2listers.PodSchedulingContextLister { +func (f *resourceClassParametersInformer) Lister() upstreamresourcev1alpha2listers.ResourceClassParametersLister { return f.lister } diff --git a/informers/resource/v1alpha1/resourceclass.go b/informers/resource/v1alpha2/resourceslice.go similarity index 66% rename from informers/resource/v1alpha1/resourceclass.go rename to informers/resource/v1alpha2/resourceslice.go index d825f456f..dd6d73118 100644 --- a/informers/resource/v1alpha1/resourceclass.go +++ b/informers/resource/v1alpha2/resourceslice.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "context" @@ -42,83 +42,83 @@ import ( resourcev1alpha2listers "github.com/kcp-dev/client-go/listers/resource/v1alpha2" ) -// ResourceClassClusterInformer provides access to a shared informer and lister for -// ResourceClasses. -type ResourceClassClusterInformer interface { - Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClassInformer +// ResourceSliceClusterInformer provides access to a shared informer and lister for +// ResourceSlices. +type ResourceSliceClusterInformer interface { + Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceSliceInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() resourcev1alpha2listers.ResourceClassClusterLister + Lister() resourcev1alpha2listers.ResourceSliceClusterLister } -type resourceClassClusterInformer struct { +type resourceSliceClusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewResourceClassClusterInformer constructs a new informer for ResourceClass type. +// NewResourceSliceClusterInformer constructs a new informer for ResourceSlice 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 NewResourceClassClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClassClusterInformer(client, resyncPeriod, indexers, nil) +func NewResourceSliceClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceSliceClusterInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredResourceClassClusterInformer constructs a new informer for ResourceClass type. +// NewFilteredResourceSliceClusterInformer constructs a new informer for ResourceSlice 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 NewFilteredResourceClassClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { +func NewFilteredResourceSliceClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { return kcpinformers.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().List(context.TODO(), options) + return client.ResourceV1alpha2().ResourceSlices().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().Watch(context.TODO(), options) + return client.ResourceV1alpha2().ResourceSlices().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClass{}, + &resourcev1alpha2.ResourceSlice{}, resyncPeriod, indexers, ) } -func (f *resourceClassClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClassClusterInformer(client, resyncPeriod, cache.Indexers{ +func (f *resourceSliceClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredResourceSliceClusterInformer(client, resyncPeriod, cache.Indexers{ kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, }, f.tweakListOptions, ) } -func (f *resourceClassClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClass{}, f.defaultInformer) +func (f *resourceSliceClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha2.ResourceSlice{}, f.defaultInformer) } -func (f *resourceClassClusterInformer) Lister() resourcev1alpha2listers.ResourceClassClusterLister { - return resourcev1alpha2listers.NewResourceClassClusterLister(f.Informer().GetIndexer()) +func (f *resourceSliceClusterInformer) Lister() resourcev1alpha2listers.ResourceSliceClusterLister { + return resourcev1alpha2listers.NewResourceSliceClusterLister(f.Informer().GetIndexer()) } -func (f *resourceClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClassInformer { - return &resourceClassInformer{ +func (f *resourceSliceClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceSliceInformer { + return &resourceSliceInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), } } -type resourceClassInformer struct { +type resourceSliceInformer struct { informer cache.SharedIndexInformer - lister upstreamresourcev1alpha2listers.ResourceClassLister + lister upstreamresourcev1alpha2listers.ResourceSliceLister } -func (f *resourceClassInformer) Informer() cache.SharedIndexInformer { +func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *resourceClassInformer) Lister() upstreamresourcev1alpha2listers.ResourceClassLister { +func (f *resourceSliceInformer) Lister() upstreamresourcev1alpha2listers.ResourceSliceLister { return f.lister } diff --git a/informers/storage/v1alpha1/interface.go b/informers/storage/v1alpha1/interface.go index 342634ea4..3f1993026 100644 --- a/informers/storage/v1alpha1/interface.go +++ b/informers/storage/v1alpha1/interface.go @@ -30,6 +30,8 @@ type ClusterInterface interface { VolumeAttachments() VolumeAttachmentClusterInformer // CSIStorageCapacities returns a CSIStorageCapacityClusterInformer CSIStorageCapacities() CSIStorageCapacityClusterInformer + // VolumeAttributesClasses returns a VolumeAttributesClassClusterInformer + VolumeAttributesClasses() VolumeAttributesClassClusterInformer } type version struct { @@ -51,3 +53,8 @@ func (v *version) VolumeAttachments() VolumeAttachmentClusterInformer { func (v *version) CSIStorageCapacities() CSIStorageCapacityClusterInformer { return &cSIStorageCapacityClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// VolumeAttributesClasses returns a VolumeAttributesClassClusterInformer +func (v *version) VolumeAttributesClasses() VolumeAttributesClassClusterInformer { + return &volumeAttributesClassClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/resource/v1alpha1/resourceclaimtemplate.go b/informers/storage/v1alpha1/volumeattributesclass.go similarity index 55% rename from informers/resource/v1alpha1/resourceclaimtemplate.go rename to informers/storage/v1alpha1/volumeattributesclass.go index 9c4dcfeeb..26d7704d6 100644 --- a/informers/resource/v1alpha1/resourceclaimtemplate.go +++ b/informers/storage/v1alpha1/volumeattributesclass.go @@ -29,96 +29,96 @@ import ( kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" "github.com/kcp-dev/logicalcluster/v3" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" - upstreamresourcev1alpha2informers "k8s.io/client-go/informers/resource/v1alpha2" - upstreamresourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + upstreamstoragev1alpha1informers "k8s.io/client-go/informers/storage/v1alpha1" + upstreamstoragev1alpha1listers "k8s.io/client-go/listers/storage/v1alpha1" "k8s.io/client-go/tools/cache" "github.com/kcp-dev/client-go/informers/internalinterfaces" clientset "github.com/kcp-dev/client-go/kubernetes" - resourcev1alpha2listers "github.com/kcp-dev/client-go/listers/resource/v1alpha2" + storagev1alpha1listers "github.com/kcp-dev/client-go/listers/storage/v1alpha1" ) -// ResourceClaimTemplateClusterInformer provides access to a shared informer and lister for -// ResourceClaimTemplates. -type ResourceClaimTemplateClusterInformer interface { - Cluster(logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimTemplateInformer +// VolumeAttributesClassClusterInformer provides access to a shared informer and lister for +// VolumeAttributesClasses. +type VolumeAttributesClassClusterInformer interface { + Cluster(logicalcluster.Name) upstreamstoragev1alpha1informers.VolumeAttributesClassInformer Informer() kcpcache.ScopeableSharedIndexInformer - Lister() resourcev1alpha2listers.ResourceClaimTemplateClusterLister + Lister() storagev1alpha1listers.VolumeAttributesClassClusterLister } -type resourceClaimTemplateClusterInformer struct { +type volumeAttributesClassClusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewResourceClaimTemplateClusterInformer constructs a new informer for ResourceClaimTemplate type. +// NewVolumeAttributesClassClusterInformer constructs a new informer for VolumeAttributesClass 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 NewResourceClaimTemplateClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClaimTemplateClusterInformer(client, resyncPeriod, indexers, nil) +func NewVolumeAttributesClassClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredVolumeAttributesClassClusterInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredResourceClaimTemplateClusterInformer constructs a new informer for ResourceClaimTemplate type. +// NewFilteredVolumeAttributesClassClusterInformer constructs a new informer for VolumeAttributesClass 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 NewFilteredResourceClaimTemplateClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { +func NewFilteredVolumeAttributesClassClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { return kcpinformers.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates().List(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates().Watch(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaimTemplate{}, + &storagev1alpha1.VolumeAttributesClass{}, resyncPeriod, indexers, ) } -func (f *resourceClaimTemplateClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { - return NewFilteredResourceClaimTemplateClusterInformer(client, resyncPeriod, cache.Indexers{ - kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, - kcpcache.ClusterAndNamespaceIndexName: kcpcache.ClusterAndNamespaceIndexFunc}, +func (f *volumeAttributesClassClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredVolumeAttributesClassClusterInformer(client, resyncPeriod, cache.Indexers{ + kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, + }, f.tweakListOptions, ) } -func (f *resourceClaimTemplateClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimTemplate{}, f.defaultInformer) +func (f *volumeAttributesClassClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&storagev1alpha1.VolumeAttributesClass{}, f.defaultInformer) } -func (f *resourceClaimTemplateClusterInformer) Lister() resourcev1alpha2listers.ResourceClaimTemplateClusterLister { - return resourcev1alpha2listers.NewResourceClaimTemplateClusterLister(f.Informer().GetIndexer()) +func (f *volumeAttributesClassClusterInformer) Lister() storagev1alpha1listers.VolumeAttributesClassClusterLister { + return storagev1alpha1listers.NewVolumeAttributesClassClusterLister(f.Informer().GetIndexer()) } -func (f *resourceClaimTemplateClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamresourcev1alpha2informers.ResourceClaimTemplateInformer { - return &resourceClaimTemplateInformer{ +func (f *volumeAttributesClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1alpha1informers.VolumeAttributesClassInformer { + return &volumeAttributesClassInformer{ informer: f.Informer().Cluster(clusterName), lister: f.Lister().Cluster(clusterName), } } -type resourceClaimTemplateInformer struct { +type volumeAttributesClassInformer struct { informer cache.SharedIndexInformer - lister upstreamresourcev1alpha2listers.ResourceClaimTemplateLister + lister upstreamstoragev1alpha1listers.VolumeAttributesClassLister } -func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { +func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { return f.informer } -func (f *resourceClaimTemplateInformer) Lister() upstreamresourcev1alpha2listers.ResourceClaimTemplateLister { +func (f *volumeAttributesClassInformer) Lister() upstreamstoragev1alpha1listers.VolumeAttributesClassLister { return f.lister } diff --git a/informers/storagemigration/interface.go b/informers/storagemigration/interface.go new file mode 100644 index 000000000..097d05a3c --- /dev/null +++ b/informers/storagemigration/interface.go @@ -0,0 +1,47 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package storagemigration + +import ( + "github.com/kcp-dev/client-go/informers/internalinterfaces" + "github.com/kcp-dev/client-go/informers/storagemigration/v1alpha1" +) + +type ClusterInterface interface { + // V1alpha1 provides access to the shared informers in V1alpha1. + V1alpha1() v1alpha1.ClusterInterface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new ClusterInterface. +func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterInterface { + return &group{factory: f, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.ClusterInterface. +func (g *group) V1alpha1() v1alpha1.ClusterInterface { + return v1alpha1.New(g.factory, g.tweakListOptions) +} diff --git a/informers/storagemigration/v1alpha1/interface.go b/informers/storagemigration/v1alpha1/interface.go new file mode 100644 index 000000000..879df0d0b --- /dev/null +++ b/informers/storagemigration/v1alpha1/interface.go @@ -0,0 +1,46 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/kcp-dev/client-go/informers/internalinterfaces" +) + +type ClusterInterface interface { + // StorageVersionMigrations returns a StorageVersionMigrationClusterInformer + StorageVersionMigrations() StorageVersionMigrationClusterInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new ClusterInterface. +func New(f internalinterfaces.SharedInformerFactory, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterInterface { + return &version{factory: f, tweakListOptions: tweakListOptions} +} + +// StorageVersionMigrations returns a StorageVersionMigrationClusterInformer +func (v *version) StorageVersionMigrations() StorageVersionMigrationClusterInformer { + return &storageVersionMigrationClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/storagemigration/v1alpha1/storageversionmigration.go b/informers/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..1ff23e6ba --- /dev/null +++ b/informers/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,124 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + upstreamstoragemigrationv1alpha1informers "k8s.io/client-go/informers/storagemigration/v1alpha1" + upstreamstoragemigrationv1alpha1listers "k8s.io/client-go/listers/storagemigration/v1alpha1" + "k8s.io/client-go/tools/cache" + + "github.com/kcp-dev/client-go/informers/internalinterfaces" + clientset "github.com/kcp-dev/client-go/kubernetes" + storagemigrationv1alpha1listers "github.com/kcp-dev/client-go/listers/storagemigration/v1alpha1" +) + +// StorageVersionMigrationClusterInformer provides access to a shared informer and lister for +// StorageVersionMigrations. +type StorageVersionMigrationClusterInformer interface { + Cluster(logicalcluster.Name) upstreamstoragemigrationv1alpha1informers.StorageVersionMigrationInformer + Informer() kcpcache.ScopeableSharedIndexInformer + Lister() storagemigrationv1alpha1listers.StorageVersionMigrationClusterLister +} + +type storageVersionMigrationClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewStorageVersionMigrationClusterInformer constructs a new informer for StorageVersionMigration 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 NewStorageVersionMigrationClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredStorageVersionMigrationClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredStorageVersionMigrationClusterInformer constructs a new informer for StorageVersionMigration 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 NewFilteredStorageVersionMigrationClusterInformer(client clientset.ClusterInterface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) kcpcache.ScopeableSharedIndexInformer { + return kcpinformers.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StoragemigrationV1alpha1().StorageVersionMigrations().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(context.TODO(), options) + }, + }, + &storagemigrationv1alpha1.StorageVersionMigration{}, + resyncPeriod, + indexers, + ) +} + +func (f *storageVersionMigrationClusterInformer) defaultInformer(client clientset.ClusterInterface, resyncPeriod time.Duration) kcpcache.ScopeableSharedIndexInformer { + return NewFilteredStorageVersionMigrationClusterInformer(client, resyncPeriod, cache.Indexers{ + kcpcache.ClusterIndexName: kcpcache.ClusterIndexFunc, + }, + f.tweakListOptions, + ) +} + +func (f *storageVersionMigrationClusterInformer) Informer() kcpcache.ScopeableSharedIndexInformer { + return f.factory.InformerFor(&storagemigrationv1alpha1.StorageVersionMigration{}, f.defaultInformer) +} + +func (f *storageVersionMigrationClusterInformer) Lister() storagemigrationv1alpha1listers.StorageVersionMigrationClusterLister { + return storagemigrationv1alpha1listers.NewStorageVersionMigrationClusterLister(f.Informer().GetIndexer()) +} + +func (f *storageVersionMigrationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragemigrationv1alpha1informers.StorageVersionMigrationInformer { + return &storageVersionMigrationInformer{ + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), + } +} + +type storageVersionMigrationInformer struct { + informer cache.SharedIndexInformer + lister upstreamstoragemigrationv1alpha1listers.StorageVersionMigrationLister +} + +func (f *storageVersionMigrationInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +func (f *storageVersionMigrationInformer) Lister() upstreamstoragemigrationv1alpha1listers.StorageVersionMigrationLister { + return f.lister +} diff --git a/kubernetes/clientset.go b/kubernetes/clientset.go index e7f330559..1e8e70bba 100644 --- a/kubernetes/clientset.go +++ b/kubernetes/clientset.go @@ -62,7 +62,7 @@ import ( eventsv1 "github.com/kcp-dev/client-go/kubernetes/typed/events/v1" eventsv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/events/v1beta1" extensionsv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/extensions/v1beta1" - flowcontrolv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1" flowcontrolv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta1" flowcontrolv1beta2 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta2" flowcontrolv1beta3 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta3" @@ -84,6 +84,7 @@ import ( storagev1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1" storagev1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1alpha1" storagev1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1beta1" + storagemigrationv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storagemigration/v1alpha1" ) type ClusterInterface interface { @@ -117,7 +118,7 @@ type ClusterInterface interface { EventsV1() eventsv1.EventsV1ClusterInterface EventsV1beta1() eventsv1beta1.EventsV1beta1ClusterInterface ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1ClusterInterface - FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1ClusterInterface + FlowcontrolV1() flowcontrolv1.FlowcontrolV1ClusterInterface FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1ClusterInterface FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2ClusterInterface FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3ClusterInterface @@ -137,6 +138,7 @@ type ClusterInterface interface { SchedulingV1() schedulingv1.SchedulingV1ClusterInterface SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1ClusterInterface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1ClusterInterface + StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1ClusterInterface StorageV1() storagev1.StorageV1ClusterInterface StorageV1alpha1() storagev1alpha1.StorageV1alpha1ClusterInterface StorageV1beta1() storagev1beta1.StorageV1beta1ClusterInterface @@ -174,7 +176,7 @@ type ClusterClientset struct { eventsV1 *eventsv1.EventsV1ClusterClient eventsV1beta1 *eventsv1beta1.EventsV1beta1ClusterClient extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1ClusterClient - flowcontrolV1alpha1 *flowcontrolv1alpha1.FlowcontrolV1alpha1ClusterClient + flowcontrolV1 *flowcontrolv1.FlowcontrolV1ClusterClient flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1ClusterClient flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2ClusterClient flowcontrolV1beta3 *flowcontrolv1beta3.FlowcontrolV1beta3ClusterClient @@ -194,6 +196,7 @@ type ClusterClientset struct { schedulingV1 *schedulingv1.SchedulingV1ClusterClient schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1ClusterClient schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1ClusterClient + storagemigrationV1alpha1 *storagemigrationv1alpha1.StoragemigrationV1alpha1ClusterClient storageV1 *storagev1.StorageV1ClusterClient storageV1alpha1 *storagev1alpha1.StorageV1alpha1ClusterClient storageV1beta1 *storagev1beta1.StorageV1beta1ClusterClient @@ -347,9 +350,9 @@ func (c *ClusterClientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1bet return c.extensionsV1beta1 } -// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1ClusterClient. -func (c *ClusterClientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1ClusterInterface { - return c.flowcontrolV1alpha1 +// FlowcontrolV1 retrieves the FlowcontrolV1ClusterClient. +func (c *ClusterClientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1ClusterInterface { + return c.flowcontrolV1 } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1ClusterClient. @@ -447,6 +450,11 @@ func (c *ClusterClientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1bet return c.schedulingV1beta1 } +// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1ClusterClient. +func (c *ClusterClientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1ClusterInterface { + return c.storagemigrationV1alpha1 +} + // StorageV1 retrieves the StorageV1ClusterClient. func (c *ClusterClientset) StorageV1() storagev1.StorageV1ClusterInterface { return c.storageV1 @@ -626,7 +634,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*ClusterCli if err != nil { return nil, err } - cs.flowcontrolV1alpha1, err = flowcontrolv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.flowcontrolV1, err = flowcontrolv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -706,6 +714,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*ClusterCli if err != nil { return nil, err } + cs.storagemigrationV1alpha1, err = storagemigrationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.storageV1, err = storagev1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err diff --git a/kubernetes/fake/clientset.go b/kubernetes/fake/clientset.go index 002797c55..579d11aee 100644 --- a/kubernetes/fake/clientset.go +++ b/kubernetes/fake/clientset.go @@ -57,7 +57,7 @@ import ( eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" @@ -79,6 +79,7 @@ import ( storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" kcpclient "github.com/kcp-dev/client-go/kubernetes" kcpadmissionregistrationv1 "github.com/kcp-dev/client-go/kubernetes/typed/admissionregistration/v1" @@ -139,8 +140,8 @@ import ( fakeeventsv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/events/v1beta1/fake" kcpextensionsv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/extensions/v1beta1" fakeextensionsv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/extensions/v1beta1/fake" - kcpflowcontrolv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1alpha1" - fakeflowcontrolv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake" + kcpflowcontrolv1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1" + fakeflowcontrolv1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1/fake" kcpflowcontrolv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta1" fakeflowcontrolv1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta1/fake" kcpflowcontrolv1beta2 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1beta2" @@ -183,6 +184,8 @@ import ( fakestoragev1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1alpha1/fake" kcpstoragev1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1beta1" fakestoragev1beta1 "github.com/kcp-dev/client-go/kubernetes/typed/storage/v1beta1/fake" + kcpstoragemigrationv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storagemigration/v1alpha1" + fakestoragemigrationv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storagemigration/v1alpha1/fake" kcpfakediscovery "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/discovery/fake" kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" ) @@ -361,9 +364,9 @@ func (c *ClusterClientset) ExtensionsV1beta1() kcpextensionsv1beta1.ExtensionsV1 return &fakeextensionsv1beta1.ExtensionsV1beta1ClusterClient{Fake: c.Fake} } -// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1ClusterClient. -func (c *ClusterClientset) FlowcontrolV1alpha1() kcpflowcontrolv1alpha1.FlowcontrolV1alpha1ClusterInterface { - return &fakeflowcontrolv1alpha1.FlowcontrolV1alpha1ClusterClient{Fake: c.Fake} +// FlowcontrolV1 retrieves the FlowcontrolV1ClusterClient. +func (c *ClusterClientset) FlowcontrolV1() kcpflowcontrolv1.FlowcontrolV1ClusterInterface { + return &fakeflowcontrolv1.FlowcontrolV1ClusterClient{Fake: c.Fake} } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1ClusterClient. @@ -461,6 +464,11 @@ func (c *ClusterClientset) SchedulingV1beta1() kcpschedulingv1beta1.SchedulingV1 return &fakeschedulingv1beta1.SchedulingV1beta1ClusterClient{Fake: c.Fake} } +// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1ClusterClient. +func (c *ClusterClientset) StoragemigrationV1alpha1() kcpstoragemigrationv1alpha1.StoragemigrationV1alpha1ClusterInterface { + return &fakestoragemigrationv1alpha1.StoragemigrationV1alpha1ClusterClient{Fake: c.Fake} +} + // StorageV1 retrieves the StorageV1ClusterClient. func (c *ClusterClientset) StorageV1() kcpstoragev1.StorageV1ClusterInterface { return &fakestoragev1.StorageV1ClusterClient{Fake: c.Fake} @@ -648,9 +656,9 @@ func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Inter return &fakeextensionsv1beta1.ExtensionsV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } -// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client. -func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { - return &fakeflowcontrolv1alpha1.FlowcontrolV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} +// FlowcontrolV1 retrieves the FlowcontrolV1Client. +func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { + return &fakeflowcontrolv1.FlowcontrolV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client. @@ -748,6 +756,11 @@ func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Inter return &fakeschedulingv1beta1.SchedulingV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } +// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client. +func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { + return &fakestoragemigrationv1alpha1.StoragemigrationV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} +} + // StorageV1 retrieves the StorageV1Client. func (c *Clientset) StorageV1() storagev1.StorageV1Interface { return &fakestoragev1.StorageV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} diff --git a/kubernetes/scheme/register.go b/kubernetes/scheme/register.go index fa9f38a0b..763af66e7 100644 --- a/kubernetes/scheme/register.go +++ b/kubernetes/scheme/register.go @@ -51,7 +51,7 @@ import ( eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" @@ -73,6 +73,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -112,7 +113,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ eventsv1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, - flowcontrolv1alpha1.AddToScheme, + flowcontrolv1.AddToScheme, flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, @@ -132,6 +133,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ schedulingv1.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, + storagemigrationv1alpha1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, storagev1beta1.AddToScheme, diff --git a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go index 7ac93ba8d..0263a9314 100644 --- a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go @@ -33,6 +33,8 @@ import ( type AdmissionregistrationV1ClusterInterface interface { AdmissionregistrationV1ClusterScoper + ValidatingAdmissionPoliciesClusterGetter + ValidatingAdmissionPolicyBindingsClusterGetter ValidatingWebhookConfigurationsClusterGetter MutatingWebhookConfigurationsClusterGetter } @@ -52,6 +54,14 @@ func (c *AdmissionregistrationV1ClusterClient) Cluster(clusterPath logicalcluste return c.clientCache.ClusterOrDie(clusterPath) } +func (c *AdmissionregistrationV1ClusterClient) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyClusterInterface { + return &validatingAdmissionPoliciesClusterInterface{clientCache: c.clientCache} +} + +func (c *AdmissionregistrationV1ClusterClient) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingClusterInterface { + return &validatingAdmissionPolicyBindingsClusterInterface{clientCache: c.clientCache} +} + func (c *AdmissionregistrationV1ClusterClient) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClusterInterface { return &validatingWebhookConfigurationsClusterInterface{clientCache: c.clientCache} } diff --git a/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go index a2bb24c2f..31b368dfb 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go @@ -44,6 +44,14 @@ func (c *AdmissionregistrationV1ClusterClient) Cluster(clusterPath logicalcluste return &AdmissionregistrationV1Client{Fake: c.Fake, ClusterPath: clusterPath} } +func (c *AdmissionregistrationV1ClusterClient) ValidatingAdmissionPolicies() kcpadmissionregistrationv1.ValidatingAdmissionPolicyClusterInterface { + return &validatingAdmissionPoliciesClusterClient{Fake: c.Fake} +} + +func (c *AdmissionregistrationV1ClusterClient) ValidatingAdmissionPolicyBindings() kcpadmissionregistrationv1.ValidatingAdmissionPolicyBindingClusterInterface { + return &validatingAdmissionPolicyBindingsClusterClient{Fake: c.Fake} +} + func (c *AdmissionregistrationV1ClusterClient) ValidatingWebhookConfigurations() kcpadmissionregistrationv1.ValidatingWebhookConfigurationClusterInterface { return &validatingWebhookConfigurationsClusterClient{Fake: c.Fake} } @@ -64,6 +72,14 @@ func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface { return ret } +func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicies() admissionregistrationv1.ValidatingAdmissionPolicyInterface { + return &validatingAdmissionPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} + +func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicyBindings() admissionregistrationv1.ValidatingAdmissionPolicyBindingInterface { + return &validatingAdmissionPolicyBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} + func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() admissionregistrationv1.ValidatingWebhookConfigurationInterface { return &validatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicy.go new file mode 100644 index 000000000..eb10324bc --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicy.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + admissionregistrationv1client "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var validatingAdmissionPoliciesResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingadmissionpolicies"} +var validatingAdmissionPoliciesKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingAdmissionPolicy"} + +type validatingAdmissionPoliciesClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *validatingAdmissionPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &validatingAdmissionPoliciesClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors across all clusters. +func (c *validatingAdmissionPoliciesClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingAdmissionPoliciesResource, validatingAdmissionPoliciesKind, logicalcluster.Wildcard, opts), &admissionregistrationv1.ValidatingAdmissionPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistrationv1.ValidatingAdmissionPolicyList{ListMeta: obj.(*admissionregistrationv1.ValidatingAdmissionPolicyList).ListMeta} + for _, item := range obj.(*admissionregistrationv1.ValidatingAdmissionPolicyList).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 ValidatingAdmissionPolicies across all clusters. +func (c *validatingAdmissionPoliciesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingAdmissionPoliciesResource, logicalcluster.Wildcard, opts)) +} + +type validatingAdmissionPoliciesClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *validatingAdmissionPoliciesClient) Create(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingAdmissionPoliciesResource, c.ClusterPath, validatingAdmissionPolicy), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +func (c *validatingAdmissionPoliciesClient) Update(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingAdmissionPoliciesResource, c.ClusterPath, validatingAdmissionPolicy), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +func (c *validatingAdmissionPoliciesClient) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingAdmissionPoliciesResource, c.ClusterPath, "status", validatingAdmissionPolicy), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +func (c *validatingAdmissionPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingAdmissionPoliciesResource, c.ClusterPath, name, opts), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + return err +} + +func (c *validatingAdmissionPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(validatingAdmissionPoliciesResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingAdmissionPolicyList{}) + return err +} + +func (c *validatingAdmissionPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingAdmissionPoliciesResource, c.ClusterPath, name), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. +func (c *validatingAdmissionPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingAdmissionPoliciesResource, validatingAdmissionPoliciesKind, c.ClusterPath, opts), &admissionregistrationv1.ValidatingAdmissionPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistrationv1.ValidatingAdmissionPolicyList{ListMeta: obj.(*admissionregistrationv1.ValidatingAdmissionPolicyList).ListMeta} + for _, item := range obj.(*admissionregistrationv1.ValidatingAdmissionPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *validatingAdmissionPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingAdmissionPoliciesResource, c.ClusterPath, opts)) +} + +func (c *validatingAdmissionPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPoliciesResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +func (c *validatingAdmissionPoliciesClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} + +func (c *validatingAdmissionPoliciesClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), err +} diff --git a/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..40ab198c1 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/fake/validatingadmissionpolicybinding.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + admissionregistrationv1client "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var validatingAdmissionPolicyBindingsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingadmissionpolicybindings"} +var validatingAdmissionPolicyBindingsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingAdmissionPolicyBinding"} + +type validatingAdmissionPolicyBindingsClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *validatingAdmissionPolicyBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyBindingInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &validatingAdmissionPolicyBindingsClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors across all clusters. +func (c *validatingAdmissionPolicyBindingsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBindingList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingAdmissionPolicyBindingsResource, validatingAdmissionPolicyBindingsKind, logicalcluster.Wildcard, opts), &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBindingList).ListMeta} + for _, item := range obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBindingList).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 ValidatingAdmissionPolicyBindings across all clusters. +func (c *validatingAdmissionPolicyBindingsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingAdmissionPolicyBindingsResource, logicalcluster.Wildcard, opts)) +} + +type validatingAdmissionPolicyBindingsClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *validatingAdmissionPolicyBindingsClient) Create(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, validatingAdmissionPolicyBinding), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +func (c *validatingAdmissionPolicyBindingsClient) Update(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, validatingAdmissionPolicyBinding), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +func (c *validatingAdmissionPolicyBindingsClient) UpdateStatus(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, "status", validatingAdmissionPolicyBinding), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +func (c *validatingAdmissionPolicyBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingAdmissionPolicyBindingsResource, c.ClusterPath, name, opts), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + return err +} + +func (c *validatingAdmissionPolicyBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{}) + return err +} + +func (c *validatingAdmissionPolicyBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, name), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. +func (c *validatingAdmissionPolicyBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBindingList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingAdmissionPolicyBindingsResource, validatingAdmissionPolicyBindingsKind, c.ClusterPath, opts), &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBindingList).ListMeta} + for _, item := range obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBindingList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *validatingAdmissionPolicyBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, opts)) +} + +func (c *validatingAdmissionPolicyBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +func (c *validatingAdmissionPolicyBindingsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} + +func (c *validatingAdmissionPolicyBindingsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingAdmissionPolicyBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), err +} diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..064e4c006 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,71 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + admissionregistrationv1client "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" +) + +// ValidatingAdmissionPoliciesClusterGetter has a method to return a ValidatingAdmissionPolicyClusterInterface. +// A group's cluster client should implement this interface. +type ValidatingAdmissionPoliciesClusterGetter interface { + ValidatingAdmissionPolicies() ValidatingAdmissionPolicyClusterInterface +} + +// ValidatingAdmissionPolicyClusterInterface can operate on ValidatingAdmissionPolicies across all clusters, +// or scope down to one cluster and return a admissionregistrationv1client.ValidatingAdmissionPolicyInterface. +type ValidatingAdmissionPolicyClusterInterface interface { + Cluster(logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyInterface + List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type validatingAdmissionPoliciesClusterInterface struct { + clientCache kcpclient.Cache[*admissionregistrationv1client.AdmissionregistrationV1Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *validatingAdmissionPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return c.clientCache.ClusterOrDie(clusterPath).ValidatingAdmissionPolicies() +} + +// List returns the entire collection of all ValidatingAdmissionPolicies across all clusters. +func (c *validatingAdmissionPoliciesClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ValidatingAdmissionPolicies().List(ctx, opts) +} + +// Watch begins to watch all ValidatingAdmissionPolicies across all clusters. +func (c *validatingAdmissionPoliciesClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ValidatingAdmissionPolicies().Watch(ctx, opts) +} diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..9df0ac6da --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,71 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + admissionregistrationv1client "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" +) + +// ValidatingAdmissionPolicyBindingsClusterGetter has a method to return a ValidatingAdmissionPolicyBindingClusterInterface. +// A group's cluster client should implement this interface. +type ValidatingAdmissionPolicyBindingsClusterGetter interface { + ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingClusterInterface +} + +// ValidatingAdmissionPolicyBindingClusterInterface can operate on ValidatingAdmissionPolicyBindings across all clusters, +// or scope down to one cluster and return a admissionregistrationv1client.ValidatingAdmissionPolicyBindingInterface. +type ValidatingAdmissionPolicyBindingClusterInterface interface { + Cluster(logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyBindingInterface + List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBindingList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type validatingAdmissionPolicyBindingsClusterInterface struct { + clientCache kcpclient.Cache[*admissionregistrationv1client.AdmissionregistrationV1Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *validatingAdmissionPolicyBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingAdmissionPolicyBindingInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return c.clientCache.ClusterOrDie(clusterPath).ValidatingAdmissionPolicyBindings() +} + +// List returns the entire collection of all ValidatingAdmissionPolicyBindings across all clusters. +func (c *validatingAdmissionPolicyBindingsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingAdmissionPolicyBindingList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ValidatingAdmissionPolicyBindings().List(ctx, opts) +} + +// Watch begins to watch all ValidatingAdmissionPolicyBindings across all clusters. +func (c *validatingAdmissionPolicyBindingsClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ValidatingAdmissionPolicyBindings().Watch(ctx, opts) +} diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1/fake/flowcontrol_client.go similarity index 53% rename from kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go rename to kubernetes/typed/flowcontrol/v1/fake/flowcontrol_client.go index 4afa3a3ad..377bcd317 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1/fake/flowcontrol_client.go @@ -24,50 +24,50 @@ package fake import ( "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" "k8s.io/client-go/rest" - kcpflowcontrolv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1alpha1" + kcpflowcontrolv1 "github.com/kcp-dev/client-go/kubernetes/typed/flowcontrol/v1" kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" ) -var _ kcpflowcontrolv1alpha1.FlowcontrolV1alpha1ClusterInterface = (*FlowcontrolV1alpha1ClusterClient)(nil) +var _ kcpflowcontrolv1.FlowcontrolV1ClusterInterface = (*FlowcontrolV1ClusterClient)(nil) -type FlowcontrolV1alpha1ClusterClient struct { +type FlowcontrolV1ClusterClient struct { *kcptesting.Fake } -func (c *FlowcontrolV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { +func (c *FlowcontrolV1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1.FlowcontrolV1Interface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &FlowcontrolV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} + return &FlowcontrolV1Client{Fake: c.Fake, ClusterPath: clusterPath} } -func (c *FlowcontrolV1alpha1ClusterClient) FlowSchemas() kcpflowcontrolv1alpha1.FlowSchemaClusterInterface { +func (c *FlowcontrolV1ClusterClient) FlowSchemas() kcpflowcontrolv1.FlowSchemaClusterInterface { return &flowSchemasClusterClient{Fake: c.Fake} } -func (c *FlowcontrolV1alpha1ClusterClient) PriorityLevelConfigurations() kcpflowcontrolv1alpha1.PriorityLevelConfigurationClusterInterface { +func (c *FlowcontrolV1ClusterClient) PriorityLevelConfigurations() kcpflowcontrolv1.PriorityLevelConfigurationClusterInterface { return &priorityLevelConfigurationsClusterClient{Fake: c.Fake} } -var _ flowcontrolv1alpha1.FlowcontrolV1alpha1Interface = (*FlowcontrolV1alpha1Client)(nil) +var _ flowcontrolv1.FlowcontrolV1Interface = (*FlowcontrolV1Client)(nil) -type FlowcontrolV1alpha1Client struct { +type FlowcontrolV1Client struct { *kcptesting.Fake ClusterPath logicalcluster.Path } -func (c *FlowcontrolV1alpha1Client) RESTClient() rest.Interface { +func (c *FlowcontrolV1Client) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } -func (c *FlowcontrolV1alpha1Client) FlowSchemas() flowcontrolv1alpha1.FlowSchemaInterface { +func (c *FlowcontrolV1Client) FlowSchemas() flowcontrolv1.FlowSchemaInterface { return &flowSchemasClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } -func (c *FlowcontrolV1alpha1Client) PriorityLevelConfigurations() flowcontrolv1alpha1.PriorityLevelConfigurationInterface { +func (c *FlowcontrolV1Client) PriorityLevelConfigurations() flowcontrolv1.PriorityLevelConfigurationInterface { return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go b/kubernetes/typed/flowcontrol/v1/fake/flowschema.go similarity index 69% rename from kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go rename to kubernetes/typed/flowcontrol/v1/fake/flowschema.go index ef228dfa5..b8d32b2d5 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/fake/flowschema.go @@ -28,28 +28,28 @@ import ( "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" - applyconfigurationsflowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" - flowcontrolv1alpha1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + applyconfigurationsflowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" "k8s.io/client-go/testing" kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" ) -var flowSchemasResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1", Resource: "flowschemas"} -var flowSchemasKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1", Kind: "FlowSchema"} +var flowSchemasResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Resource: "flowschemas"} +var flowSchemasKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "FlowSchema"} type flowSchemasClusterClient struct { *kcptesting.Fake } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface { +func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1client.FlowSchemaInterface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } @@ -58,8 +58,8 @@ func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flow } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors across all clusters. -func (c *flowSchemasClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, logicalcluster.Wildcard, opts), &flowcontrolv1alpha1.FlowSchemaList{}) +func (c *flowSchemasClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.FlowSchemaList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, logicalcluster.Wildcard, opts), &flowcontrolv1.FlowSchemaList{}) if obj == nil { return nil, err } @@ -68,8 +68,8 @@ func (c *flowSchemasClusterClient) List(ctx context.Context, opts metav1.ListOpt if label == nil { label = labels.Everything() } - list := &flowcontrolv1alpha1.FlowSchemaList{ListMeta: obj.(*flowcontrolv1alpha1.FlowSchemaList).ListMeta} - for _, item := range obj.(*flowcontrolv1alpha1.FlowSchemaList).Items { + list := &flowcontrolv1.FlowSchemaList{ListMeta: obj.(*flowcontrolv1.FlowSchemaList).ListMeta} + for _, item := range obj.(*flowcontrolv1.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -87,53 +87,53 @@ type flowSchemasClient struct { ClusterPath logicalcluster.Path } -func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) +func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1.FlowSchema, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } -func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) +func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1.FlowSchema, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } -func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.ClusterPath, "status", flowSchema), &flowcontrolv1alpha1.FlowSchema{}) +func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1.FlowSchema, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.ClusterPath, "status", flowSchema), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } func (c *flowSchemasClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.ClusterPath, name, opts), &flowcontrolv1alpha1.FlowSchema{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.ClusterPath, name, opts), &flowcontrolv1.FlowSchema{}) return err } func (c *flowSchemasClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.ClusterPath, listOpts) - _, err := c.Fake.Invokes(action, &flowcontrolv1alpha1.FlowSchemaList{}) + _, err := c.Fake.Invokes(action, &flowcontrolv1.FlowSchemaList{}) return err } -func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.ClusterPath, name), &flowcontrolv1alpha1.FlowSchema{}) +func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1.FlowSchema, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.ClusterPath, name), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.ClusterPath, opts), &flowcontrolv1alpha1.FlowSchemaList{}) +func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.FlowSchemaList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.ClusterPath, opts), &flowcontrolv1.FlowSchemaList{}) if obj == nil { return nil, err } @@ -142,8 +142,8 @@ func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) ( if label == nil { label = labels.Everything() } - list := &flowcontrolv1alpha1.FlowSchemaList{ListMeta: obj.(*flowcontrolv1alpha1.FlowSchemaList).ListMeta} - for _, item := range obj.(*flowcontrolv1alpha1.FlowSchemaList).Items { + list := &flowcontrolv1.FlowSchemaList{ListMeta: obj.(*flowcontrolv1.FlowSchemaList).ListMeta} + for _, item := range obj.(*flowcontrolv1.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -155,15 +155,15 @@ func (c *flowSchemasClient) Watch(ctx context.Context, opts metav1.ListOptions) return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.ClusterPath, opts)) } -func (c *flowSchemasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1alpha1.FlowSchema{}) +func (c *flowSchemasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1.FlowSchema, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } -func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1alpha1.FlowSchema, error) { +func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1.FlowSchema, error) { if applyConfiguration == nil { return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") } @@ -175,14 +175,14 @@ func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } -func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1alpha1.FlowSchema, error) { +func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1.FlowSchema, error) { if applyConfiguration == nil { return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") } @@ -194,9 +194,9 @@ func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.FlowSchema), err + return obj.(*flowcontrolv1.FlowSchema), err } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/fake/prioritylevelconfiguration.go similarity index 66% rename from kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go rename to kubernetes/typed/flowcontrol/v1/fake/prioritylevelconfiguration.go index f92783652..0c5751d9a 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/fake/prioritylevelconfiguration.go @@ -28,28 +28,28 @@ import ( "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" - applyconfigurationsflowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" - flowcontrolv1alpha1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + applyconfigurationsflowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" "k8s.io/client-go/testing" kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" ) -var priorityLevelConfigurationsResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1", Resource: "prioritylevelconfigurations"} -var priorityLevelConfigurationsKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1", Kind: "PriorityLevelConfiguration"} +var priorityLevelConfigurationsResource = schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Resource: "prioritylevelconfigurations"} +var priorityLevelConfigurationsKind = schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "PriorityLevelConfiguration"} type priorityLevelConfigurationsClusterClient struct { *kcptesting.Fake } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { +func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1client.PriorityLevelConfigurationInterface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } @@ -58,8 +58,8 @@ func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcl } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors across all clusters. -func (c *priorityLevelConfigurationsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, logicalcluster.Wildcard, opts), &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) +func (c *priorityLevelConfigurationsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.PriorityLevelConfigurationList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, logicalcluster.Wildcard, opts), &flowcontrolv1.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -68,8 +68,8 @@ func (c *priorityLevelConfigurationsClusterClient) List(ctx context.Context, opt if label == nil { label = labels.Everything() } - list := &flowcontrolv1alpha1.PriorityLevelConfigurationList{ListMeta: obj.(*flowcontrolv1alpha1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*flowcontrolv1alpha1.PriorityLevelConfigurationList).Items { + list := &flowcontrolv1.PriorityLevelConfigurationList{ListMeta: obj.(*flowcontrolv1.PriorityLevelConfigurationList).ListMeta} + for _, item := range obj.(*flowcontrolv1.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -87,53 +87,53 @@ type priorityLevelConfigurationsClient struct { ClusterPath logicalcluster.Path } -func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) +func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } -func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) +func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } -func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, "status", priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) +func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, "status", priorityLevelConfiguration), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } func (c *priorityLevelConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.ClusterPath, name, opts), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.ClusterPath, name, opts), &flowcontrolv1.PriorityLevelConfiguration{}) return err } func (c *priorityLevelConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.ClusterPath, listOpts) - _, err := c.Fake.Invokes(action, &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) + _, err := c.Fake.Invokes(action, &flowcontrolv1.PriorityLevelConfigurationList{}) return err } -func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.ClusterPath, name), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) +func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.ClusterPath, name), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.ClusterPath, opts), &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) +func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.PriorityLevelConfigurationList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.ClusterPath, opts), &flowcontrolv1.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -142,8 +142,8 @@ func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav if label == nil { label = labels.Everything() } - list := &flowcontrolv1alpha1.PriorityLevelConfigurationList{ListMeta: obj.(*flowcontrolv1alpha1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*flowcontrolv1alpha1.PriorityLevelConfigurationList).Items { + list := &flowcontrolv1.PriorityLevelConfigurationList{ListMeta: obj.(*flowcontrolv1.PriorityLevelConfigurationList).ListMeta} + for _, item := range obj.(*flowcontrolv1.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -155,15 +155,15 @@ func (c *priorityLevelConfigurationsClient) Watch(ctx context.Context, opts meta return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.ClusterPath, opts)) } -func (c *priorityLevelConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) +func (c *priorityLevelConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1.PriorityLevelConfiguration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } -func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { +func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { if applyConfiguration == nil { return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") } @@ -175,14 +175,14 @@ func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConf if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } -func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { +func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsflowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (*flowcontrolv1.PriorityLevelConfiguration, error) { if applyConfiguration == nil { return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") } @@ -194,9 +194,9 @@ func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, app if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), err + return obj.(*flowcontrolv1.PriorityLevelConfiguration), err } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go similarity index 57% rename from kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go rename to kubernetes/typed/flowcontrol/v1/flowcontrol_client.go index 6f7138fba..19df8110a 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "net/http" @@ -27,43 +27,43 @@ import ( kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" "k8s.io/client-go/rest" ) -type FlowcontrolV1alpha1ClusterInterface interface { - FlowcontrolV1alpha1ClusterScoper +type FlowcontrolV1ClusterInterface interface { + FlowcontrolV1ClusterScoper FlowSchemasClusterGetter PriorityLevelConfigurationsClusterGetter } -type FlowcontrolV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface +type FlowcontrolV1ClusterScoper interface { + Cluster(logicalcluster.Path) flowcontrolv1.FlowcontrolV1Interface } -type FlowcontrolV1alpha1ClusterClient struct { - clientCache kcpclient.Cache[*flowcontrolv1alpha1.FlowcontrolV1alpha1Client] +type FlowcontrolV1ClusterClient struct { + clientCache kcpclient.Cache[*flowcontrolv1.FlowcontrolV1Client] } -func (c *FlowcontrolV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { +func (c *FlowcontrolV1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1.FlowcontrolV1Interface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } return c.clientCache.ClusterOrDie(clusterPath) } -func (c *FlowcontrolV1alpha1ClusterClient) FlowSchemas() FlowSchemaClusterInterface { +func (c *FlowcontrolV1ClusterClient) FlowSchemas() FlowSchemaClusterInterface { return &flowSchemasClusterInterface{clientCache: c.clientCache} } -func (c *FlowcontrolV1alpha1ClusterClient) PriorityLevelConfigurations() PriorityLevelConfigurationClusterInterface { +func (c *FlowcontrolV1ClusterClient) PriorityLevelConfigurations() PriorityLevelConfigurationClusterInterface { return &priorityLevelConfigurationsClusterInterface{clientCache: c.clientCache} } -// NewForConfig creates a new FlowcontrolV1alpha1ClusterClient for the given config. +// NewForConfig creates a new FlowcontrolV1ClusterClient for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*FlowcontrolV1alpha1ClusterClient, error) { +func NewForConfig(c *rest.Config) (*FlowcontrolV1ClusterClient, error) { client, err := rest.HTTPClientFor(c) if err != nil { return nil, err @@ -71,21 +71,21 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1alpha1ClusterClient, error) { return NewForConfigAndClient(c, client) } -// NewForConfigAndClient creates a new FlowcontrolV1alpha1ClusterClient for the given config and http client. +// NewForConfigAndClient creates a new FlowcontrolV1ClusterClient for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1alpha1ClusterClient, error) { - cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*flowcontrolv1alpha1.FlowcontrolV1alpha1Client]{ - NewForConfigAndClient: flowcontrolv1alpha1.NewForConfigAndClient, +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1ClusterClient, error) { + cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*flowcontrolv1.FlowcontrolV1Client]{ + NewForConfigAndClient: flowcontrolv1.NewForConfigAndClient, }) if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } - return &FlowcontrolV1alpha1ClusterClient{clientCache: cache}, nil + return &FlowcontrolV1ClusterClient{clientCache: cache}, nil } -// NewForConfigOrDie creates a new FlowcontrolV1alpha1ClusterClient for the given config and +// NewForConfigOrDie creates a new FlowcontrolV1ClusterClient for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1alpha1ClusterClient { +func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1ClusterClient { client, err := NewForConfig(c) if err != nil { panic(err) diff --git a/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go b/kubernetes/typed/flowcontrol/v1/flowschema.go similarity index 79% rename from kubernetes/typed/flowcontrol/v1alpha1/flowschema.go rename to kubernetes/typed/flowcontrol/v1/flowschema.go index e142a2f25..7227d53e1 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/flowschema.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "context" @@ -27,10 +27,10 @@ import ( kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" - flowcontrolv1alpha1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" ) // FlowSchemasClusterGetter has a method to return a FlowSchemaClusterInterface. @@ -40,19 +40,19 @@ type FlowSchemasClusterGetter interface { } // FlowSchemaClusterInterface can operate on FlowSchemas across all clusters, -// or scope down to one cluster and return a flowcontrolv1alpha1client.FlowSchemaInterface. +// or scope down to one cluster and return a flowcontrolv1client.FlowSchemaInterface. type FlowSchemaClusterInterface interface { - Cluster(logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface - List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) + Cluster(logicalcluster.Path) flowcontrolv1client.FlowSchemaInterface + List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.FlowSchemaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } type flowSchemasClusterInterface struct { - clientCache kcpclient.Cache[*flowcontrolv1alpha1client.FlowcontrolV1alpha1Client] + clientCache kcpclient.Cache[*flowcontrolv1client.FlowcontrolV1Client] } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface { +func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1client.FlowSchemaInterface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } @@ -61,7 +61,7 @@ func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) f } // List returns the entire collection of all FlowSchemas across all clusters. -func (c *flowSchemasClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) { +func (c *flowSchemasClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.FlowSchemaList, error) { return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).FlowSchemas().List(ctx, opts) } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go similarity index 78% rename from kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go rename to kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go index a9e4db7a8..3dbf88d26 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( "context" @@ -27,10 +27,10 @@ import ( kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" - flowcontrolv1alpha1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + flowcontrolv1client "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" ) // PriorityLevelConfigurationsClusterGetter has a method to return a PriorityLevelConfigurationClusterInterface. @@ -40,19 +40,19 @@ type PriorityLevelConfigurationsClusterGetter interface { } // PriorityLevelConfigurationClusterInterface can operate on PriorityLevelConfigurations across all clusters, -// or scope down to one cluster and return a flowcontrolv1alpha1client.PriorityLevelConfigurationInterface. +// or scope down to one cluster and return a flowcontrolv1client.PriorityLevelConfigurationInterface. type PriorityLevelConfigurationClusterInterface interface { - Cluster(logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface - List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) + Cluster(logicalcluster.Path) flowcontrolv1client.PriorityLevelConfigurationInterface + List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } type priorityLevelConfigurationsClusterInterface struct { - clientCache kcpclient.Cache[*flowcontrolv1alpha1client.FlowcontrolV1alpha1Client] + clientCache kcpclient.Cache[*flowcontrolv1client.FlowcontrolV1Client] } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { +func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1client.PriorityLevelConfigurationInterface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } @@ -61,7 +61,7 @@ func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logica } // List returns the entire collection of all PriorityLevelConfigurations across all clusters. -func (c *priorityLevelConfigurationsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) { +func (c *priorityLevelConfigurationsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1.PriorityLevelConfigurationList, error) { return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).PriorityLevelConfigurations().List(ctx, opts) } diff --git a/kubernetes/typed/networking/v1alpha1/fake/clustercidr.go b/kubernetes/typed/networking/v1alpha1/fake/clustercidr.go deleted file mode 100644 index 964ba9c15..000000000 --- a/kubernetes/typed/networking/v1alpha1/fake/clustercidr.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package fake - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/kcp-dev/logicalcluster/v3" - - networkingv1alpha1 "k8s.io/api/networking/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - applyconfigurationsnetworkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - networkingv1alpha1client "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" - "k8s.io/client-go/testing" - - kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" -) - -var clusterCIDRsResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1alpha1", Resource: "clustercidrs"} -var clusterCIDRsKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1alpha1", Kind: "ClusterCIDR"} - -type clusterCIDRsClusterClient struct { - *kcptesting.Fake -} - -// Cluster scopes the client down to a particular cluster. -func (c *clusterCIDRsClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1alpha1client.ClusterCIDRInterface { - if clusterPath == logicalcluster.Wildcard { - panic("A specific cluster must be provided when scoping, not the wildcard.") - } - - return &clusterCIDRsClient{Fake: c.Fake, ClusterPath: clusterPath} -} - -// List takes label and field selectors, and returns the list of ClusterCIDRs that match those selectors across all clusters. -func (c *clusterCIDRsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ClusterCIDRList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterCIDRsResource, clusterCIDRsKind, logicalcluster.Wildcard, opts), &networkingv1alpha1.ClusterCIDRList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &networkingv1alpha1.ClusterCIDRList{ListMeta: obj.(*networkingv1alpha1.ClusterCIDRList).ListMeta} - for _, item := range obj.(*networkingv1alpha1.ClusterCIDRList).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 ClusterCIDRs across all clusters. -func (c *clusterCIDRsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterCIDRsResource, logicalcluster.Wildcard, opts)) -} - -type clusterCIDRsClient struct { - *kcptesting.Fake - ClusterPath logicalcluster.Path -} - -func (c *clusterCIDRsClient) Create(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDR, opts metav1.CreateOptions) (*networkingv1alpha1.ClusterCIDR, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterCIDRsResource, c.ClusterPath, clusterCIDR), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -func (c *clusterCIDRsClient) Update(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDR, opts metav1.UpdateOptions) (*networkingv1alpha1.ClusterCIDR, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterCIDRsResource, c.ClusterPath, clusterCIDR), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -func (c *clusterCIDRsClient) UpdateStatus(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDR, opts metav1.UpdateOptions) (*networkingv1alpha1.ClusterCIDR, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterCIDRsResource, c.ClusterPath, "status", clusterCIDR), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -func (c *clusterCIDRsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterCIDRsResource, c.ClusterPath, name, opts), &networkingv1alpha1.ClusterCIDR{}) - return err -} - -func (c *clusterCIDRsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterCIDRsResource, c.ClusterPath, listOpts) - - _, err := c.Fake.Invokes(action, &networkingv1alpha1.ClusterCIDRList{}) - return err -} - -func (c *clusterCIDRsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1alpha1.ClusterCIDR, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterCIDRsResource, c.ClusterPath, name), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -// List takes label and field selectors, and returns the list of ClusterCIDRs that match those selectors. -func (c *clusterCIDRsClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ClusterCIDRList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterCIDRsResource, clusterCIDRsKind, c.ClusterPath, opts), &networkingv1alpha1.ClusterCIDRList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &networkingv1alpha1.ClusterCIDRList{ListMeta: obj.(*networkingv1alpha1.ClusterCIDRList).ListMeta} - for _, item := range obj.(*networkingv1alpha1.ClusterCIDRList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -func (c *clusterCIDRsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterCIDRsResource, c.ClusterPath, opts)) -} - -func (c *clusterCIDRsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1alpha1.ClusterCIDR, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterCIDRsResource, c.ClusterPath, name, pt, data, subresources...), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -func (c *clusterCIDRsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsnetworkingv1alpha1.ClusterCIDRApplyConfiguration, opts metav1.ApplyOptions) (*networkingv1alpha1.ClusterCIDR, error) { - if applyConfiguration == nil { - return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(applyConfiguration) - if err != nil { - return nil, err - } - name := applyConfiguration.Name - if name == nil { - return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterCIDRsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} - -func (c *clusterCIDRsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsnetworkingv1alpha1.ClusterCIDRApplyConfiguration, opts metav1.ApplyOptions) (*networkingv1alpha1.ClusterCIDR, error) { - if applyConfiguration == nil { - return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(applyConfiguration) - if err != nil { - return nil, err - } - name := applyConfiguration.Name - if name == nil { - return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterCIDRsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &networkingv1alpha1.ClusterCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*networkingv1alpha1.ClusterCIDR), err -} diff --git a/kubernetes/typed/networking/v1alpha1/fake/networking_client.go b/kubernetes/typed/networking/v1alpha1/fake/networking_client.go index 7cded12f5..5f9c11148 100644 --- a/kubernetes/typed/networking/v1alpha1/fake/networking_client.go +++ b/kubernetes/typed/networking/v1alpha1/fake/networking_client.go @@ -44,14 +44,14 @@ func (c *NetworkingV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Pat return &NetworkingV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } -func (c *NetworkingV1alpha1ClusterClient) ClusterCIDRs() kcpnetworkingv1alpha1.ClusterCIDRClusterInterface { - return &clusterCIDRsClusterClient{Fake: c.Fake} -} - func (c *NetworkingV1alpha1ClusterClient) IPAddresses() kcpnetworkingv1alpha1.IPAddressClusterInterface { return &iPAddressesClusterClient{Fake: c.Fake} } +func (c *NetworkingV1alpha1ClusterClient) ServiceCIDRs() kcpnetworkingv1alpha1.ServiceCIDRClusterInterface { + return &serviceCIDRsClusterClient{Fake: c.Fake} +} + var _ networkingv1alpha1.NetworkingV1alpha1Interface = (*NetworkingV1alpha1Client)(nil) type NetworkingV1alpha1Client struct { @@ -64,10 +64,10 @@ func (c *NetworkingV1alpha1Client) RESTClient() rest.Interface { return ret } -func (c *NetworkingV1alpha1Client) ClusterCIDRs() networkingv1alpha1.ClusterCIDRInterface { - return &clusterCIDRsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} -} - func (c *NetworkingV1alpha1Client) IPAddresses() networkingv1alpha1.IPAddressInterface { return &iPAddressesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } + +func (c *NetworkingV1alpha1Client) ServiceCIDRs() networkingv1alpha1.ServiceCIDRInterface { + return &serviceCIDRsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} diff --git a/kubernetes/typed/networking/v1alpha1/fake/servicecidr.go b/kubernetes/typed/networking/v1alpha1/fake/servicecidr.go new file mode 100644 index 000000000..a4b1150ba --- /dev/null +++ b/kubernetes/typed/networking/v1alpha1/fake/servicecidr.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + networkingv1alpha1 "k8s.io/api/networking/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsnetworkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" + networkingv1alpha1client "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var serviceCIDRsResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1alpha1", Resource: "servicecidrs"} +var serviceCIDRsKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1alpha1", Kind: "ServiceCIDR"} + +type serviceCIDRsClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *serviceCIDRsClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1alpha1client.ServiceCIDRInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &serviceCIDRsClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors across all clusters. +func (c *serviceCIDRsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ServiceCIDRList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(serviceCIDRsResource, serviceCIDRsKind, logicalcluster.Wildcard, opts), &networkingv1alpha1.ServiceCIDRList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkingv1alpha1.ServiceCIDRList{ListMeta: obj.(*networkingv1alpha1.ServiceCIDRList).ListMeta} + for _, item := range obj.(*networkingv1alpha1.ServiceCIDRList).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 ServiceCIDRs across all clusters. +func (c *serviceCIDRsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(serviceCIDRsResource, logicalcluster.Wildcard, opts)) +} + +type serviceCIDRsClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *serviceCIDRsClient) Create(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDR, opts metav1.CreateOptions) (*networkingv1alpha1.ServiceCIDR, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(serviceCIDRsResource, c.ClusterPath, serviceCIDR), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +func (c *serviceCIDRsClient) Update(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDR, opts metav1.UpdateOptions) (*networkingv1alpha1.ServiceCIDR, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(serviceCIDRsResource, c.ClusterPath, serviceCIDR), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +func (c *serviceCIDRsClient) UpdateStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDR, opts metav1.UpdateOptions) (*networkingv1alpha1.ServiceCIDR, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(serviceCIDRsResource, c.ClusterPath, "status", serviceCIDR), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +func (c *serviceCIDRsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(serviceCIDRsResource, c.ClusterPath, name, opts), &networkingv1alpha1.ServiceCIDR{}) + return err +} + +func (c *serviceCIDRsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(serviceCIDRsResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &networkingv1alpha1.ServiceCIDRList{}) + return err +} + +func (c *serviceCIDRsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1alpha1.ServiceCIDR, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(serviceCIDRsResource, c.ClusterPath, name), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. +func (c *serviceCIDRsClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ServiceCIDRList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(serviceCIDRsResource, serviceCIDRsKind, c.ClusterPath, opts), &networkingv1alpha1.ServiceCIDRList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkingv1alpha1.ServiceCIDRList{ListMeta: obj.(*networkingv1alpha1.ServiceCIDRList).ListMeta} + for _, item := range obj.(*networkingv1alpha1.ServiceCIDRList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *serviceCIDRsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(serviceCIDRsResource, c.ClusterPath, opts)) +} + +func (c *serviceCIDRsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1alpha1.ServiceCIDR, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(serviceCIDRsResource, c.ClusterPath, name, pt, data, subresources...), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +func (c *serviceCIDRsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsnetworkingv1alpha1.ServiceCIDRApplyConfiguration, opts metav1.ApplyOptions) (*networkingv1alpha1.ServiceCIDR, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(serviceCIDRsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} + +func (c *serviceCIDRsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsnetworkingv1alpha1.ServiceCIDRApplyConfiguration, opts metav1.ApplyOptions) (*networkingv1alpha1.ServiceCIDR, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(serviceCIDRsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &networkingv1alpha1.ServiceCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1alpha1.ServiceCIDR), err +} diff --git a/kubernetes/typed/networking/v1alpha1/networking_client.go b/kubernetes/typed/networking/v1alpha1/networking_client.go index de97c2313..afe6d0478 100644 --- a/kubernetes/typed/networking/v1alpha1/networking_client.go +++ b/kubernetes/typed/networking/v1alpha1/networking_client.go @@ -33,8 +33,8 @@ import ( type NetworkingV1alpha1ClusterInterface interface { NetworkingV1alpha1ClusterScoper - ClusterCIDRsClusterGetter IPAddressesClusterGetter + ServiceCIDRsClusterGetter } type NetworkingV1alpha1ClusterScoper interface { @@ -52,14 +52,14 @@ func (c *NetworkingV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Pat return c.clientCache.ClusterOrDie(clusterPath) } -func (c *NetworkingV1alpha1ClusterClient) ClusterCIDRs() ClusterCIDRClusterInterface { - return &clusterCIDRsClusterInterface{clientCache: c.clientCache} -} - func (c *NetworkingV1alpha1ClusterClient) IPAddresses() IPAddressClusterInterface { return &iPAddressesClusterInterface{clientCache: c.clientCache} } +func (c *NetworkingV1alpha1ClusterClient) ServiceCIDRs() ServiceCIDRClusterInterface { + return &serviceCIDRsClusterInterface{clientCache: c.clientCache} +} + // NewForConfig creates a new NetworkingV1alpha1ClusterClient for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/networking/v1alpha1/clustercidr.go b/kubernetes/typed/networking/v1alpha1/servicecidr.go similarity index 60% rename from kubernetes/typed/networking/v1alpha1/clustercidr.go rename to kubernetes/typed/networking/v1alpha1/servicecidr.go index c1991e959..c5293df78 100644 --- a/kubernetes/typed/networking/v1alpha1/clustercidr.go +++ b/kubernetes/typed/networking/v1alpha1/servicecidr.go @@ -33,39 +33,39 @@ import ( networkingv1alpha1client "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" ) -// ClusterCIDRsClusterGetter has a method to return a ClusterCIDRClusterInterface. +// ServiceCIDRsClusterGetter has a method to return a ServiceCIDRClusterInterface. // A group's cluster client should implement this interface. -type ClusterCIDRsClusterGetter interface { - ClusterCIDRs() ClusterCIDRClusterInterface +type ServiceCIDRsClusterGetter interface { + ServiceCIDRs() ServiceCIDRClusterInterface } -// ClusterCIDRClusterInterface can operate on ClusterCIDRs across all clusters, -// or scope down to one cluster and return a networkingv1alpha1client.ClusterCIDRInterface. -type ClusterCIDRClusterInterface interface { - Cluster(logicalcluster.Path) networkingv1alpha1client.ClusterCIDRInterface - List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ClusterCIDRList, error) +// ServiceCIDRClusterInterface can operate on ServiceCIDRs across all clusters, +// or scope down to one cluster and return a networkingv1alpha1client.ServiceCIDRInterface. +type ServiceCIDRClusterInterface interface { + Cluster(logicalcluster.Path) networkingv1alpha1client.ServiceCIDRInterface + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ServiceCIDRList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } -type clusterCIDRsClusterInterface struct { +type serviceCIDRsClusterInterface struct { clientCache kcpclient.Cache[*networkingv1alpha1client.NetworkingV1alpha1Client] } // Cluster scopes the client down to a particular cluster. -func (c *clusterCIDRsClusterInterface) Cluster(clusterPath logicalcluster.Path) networkingv1alpha1client.ClusterCIDRInterface { +func (c *serviceCIDRsClusterInterface) Cluster(clusterPath logicalcluster.Path) networkingv1alpha1client.ServiceCIDRInterface { if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(clusterPath).ClusterCIDRs() + return c.clientCache.ClusterOrDie(clusterPath).ServiceCIDRs() } -// List returns the entire collection of all ClusterCIDRs across all clusters. -func (c *clusterCIDRsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ClusterCIDRList, error) { - return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ClusterCIDRs().List(ctx, opts) +// List returns the entire collection of all ServiceCIDRs across all clusters. +func (c *serviceCIDRsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1alpha1.ServiceCIDRList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ServiceCIDRs().List(ctx, opts) } -// Watch begins to watch all ClusterCIDRs across all clusters. -func (c *clusterCIDRsClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ClusterCIDRs().Watch(ctx, opts) +// Watch begins to watch all ServiceCIDRs across all clusters. +func (c *serviceCIDRsClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ServiceCIDRs().Watch(ctx, opts) } diff --git a/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go b/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go deleted file mode 100644 index eee24ded5..000000000 --- a/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package fake - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/kcp-dev/logicalcluster/v3" - - policyv1beta1 "k8s.io/api/policy/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - applyconfigurationspolicyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" - policyv1beta1client "k8s.io/client-go/kubernetes/typed/policy/v1beta1" - "k8s.io/client-go/testing" - - kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" -) - -var podSecurityPoliciesResource = schema.GroupVersionResource{Group: "policy", Version: "v1beta1", Resource: "podsecuritypolicies"} -var podSecurityPoliciesKind = schema.GroupVersionKind{Group: "policy", Version: "v1beta1", Kind: "PodSecurityPolicy"} - -type podSecurityPoliciesClusterClient struct { - *kcptesting.Fake -} - -// Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface { - if clusterPath == logicalcluster.Wildcard { - panic("A specific cluster must be provided when scoping, not the wildcard.") - } - - return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: clusterPath} -} - -// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors across all clusters. -func (c *podSecurityPoliciesClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, logicalcluster.Wildcard, opts), &policyv1beta1.PodSecurityPolicyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policyv1beta1.PodSecurityPolicyList{ListMeta: obj.(*policyv1beta1.PodSecurityPolicyList).ListMeta} - for _, item := range obj.(*policyv1beta1.PodSecurityPolicyList).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 PodSecurityPolicies across all clusters. -func (c *podSecurityPoliciesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, logicalcluster.Wildcard, opts)) -} - -type podSecurityPoliciesClient struct { - *kcptesting.Fake - ClusterPath logicalcluster.Path -} - -func (c *podSecurityPoliciesClient) Create(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.CreateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -func (c *podSecurityPoliciesClient) Update(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -func (c *podSecurityPoliciesClient) UpdateStatus(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, "status", podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -func (c *podSecurityPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(podSecurityPoliciesResource, c.ClusterPath, name, opts), &policyv1beta1.PodSecurityPolicy{}) - return err -} - -func (c *podSecurityPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(podSecurityPoliciesResource, c.ClusterPath, listOpts) - - _, err := c.Fake.Invokes(action, &policyv1beta1.PodSecurityPolicyList{}) - return err -} - -func (c *podSecurityPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(podSecurityPoliciesResource, c.ClusterPath, name), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. -func (c *podSecurityPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, c.ClusterPath, opts), &policyv1beta1.PodSecurityPolicyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policyv1beta1.PodSecurityPolicyList{ListMeta: obj.(*policyv1beta1.PodSecurityPolicyList).ListMeta} - for _, item := range obj.(*policyv1beta1.PodSecurityPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -func (c *podSecurityPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, c.ClusterPath, opts)) -} - -func (c *podSecurityPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, name, pt, data, subresources...), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -func (c *podSecurityPoliciesClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationspolicyv1beta1.PodSecurityPolicyApplyConfiguration, opts metav1.ApplyOptions) (*policyv1beta1.PodSecurityPolicy, error) { - if applyConfiguration == nil { - return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(applyConfiguration) - if err != nil { - return nil, err - } - name := applyConfiguration.Name - if name == nil { - return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} - -func (c *podSecurityPoliciesClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationspolicyv1beta1.PodSecurityPolicyApplyConfiguration, opts metav1.ApplyOptions) (*policyv1beta1.PodSecurityPolicy, error) { - if applyConfiguration == nil { - return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(applyConfiguration) - if err != nil { - return nil, err - } - name := applyConfiguration.Name - if name == nil { - return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &policyv1beta1.PodSecurityPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policyv1beta1.PodSecurityPolicy), err -} diff --git a/kubernetes/typed/policy/v1beta1/fake/policy_client.go b/kubernetes/typed/policy/v1beta1/fake/policy_client.go index 6da0ba5cb..81c9715ac 100644 --- a/kubernetes/typed/policy/v1beta1/fake/policy_client.go +++ b/kubernetes/typed/policy/v1beta1/fake/policy_client.go @@ -52,10 +52,6 @@ func (c *PolicyV1beta1ClusterClient) Evictions() kcppolicyv1beta1.EvictionCluste return &evictionsClusterClient{Fake: c.Fake} } -func (c *PolicyV1beta1ClusterClient) PodSecurityPolicies() kcppolicyv1beta1.PodSecurityPolicyClusterInterface { - return &podSecurityPoliciesClusterClient{Fake: c.Fake} -} - var _ policyv1beta1.PolicyV1beta1Interface = (*PolicyV1beta1Client)(nil) type PolicyV1beta1Client struct { @@ -75,7 +71,3 @@ func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) policyv1bet func (c *PolicyV1beta1Client) Evictions(namespace string) policyv1beta1.EvictionInterface { return &evictionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } - -func (c *PolicyV1beta1Client) PodSecurityPolicies() policyv1beta1.PodSecurityPolicyInterface { - return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} -} diff --git a/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go deleted file mode 100644 index 4b4361c1e..000000000 --- a/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - - kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" - "github.com/kcp-dev/logicalcluster/v3" - - policyv1beta1 "k8s.io/api/policy/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" - policyv1beta1client "k8s.io/client-go/kubernetes/typed/policy/v1beta1" -) - -// PodSecurityPoliciesClusterGetter has a method to return a PodSecurityPolicyClusterInterface. -// A group's cluster client should implement this interface. -type PodSecurityPoliciesClusterGetter interface { - PodSecurityPolicies() PodSecurityPolicyClusterInterface -} - -// PodSecurityPolicyClusterInterface can operate on PodSecurityPolicies across all clusters, -// or scope down to one cluster and return a policyv1beta1client.PodSecurityPolicyInterface. -type PodSecurityPolicyClusterInterface interface { - Cluster(logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface - List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) -} - -type podSecurityPoliciesClusterInterface struct { - clientCache kcpclient.Cache[*policyv1beta1client.PolicyV1beta1Client] -} - -// Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface { - if clusterPath == logicalcluster.Wildcard { - panic("A specific cluster must be provided when scoping, not the wildcard.") - } - - return c.clientCache.ClusterOrDie(clusterPath).PodSecurityPolicies() -} - -// List returns the entire collection of all PodSecurityPolicies across all clusters. -func (c *podSecurityPoliciesClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) { - return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).PodSecurityPolicies().List(ctx, opts) -} - -// Watch begins to watch all PodSecurityPolicies across all clusters. -func (c *podSecurityPoliciesClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).PodSecurityPolicies().Watch(ctx, opts) -} diff --git a/kubernetes/typed/policy/v1beta1/policy_client.go b/kubernetes/typed/policy/v1beta1/policy_client.go index b0cbd5460..4b2952b30 100644 --- a/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/kubernetes/typed/policy/v1beta1/policy_client.go @@ -35,7 +35,6 @@ type PolicyV1beta1ClusterInterface interface { PolicyV1beta1ClusterScoper PodDisruptionBudgetsClusterGetter EvictionsClusterGetter - PodSecurityPoliciesClusterGetter } type PolicyV1beta1ClusterScoper interface { @@ -61,10 +60,6 @@ func (c *PolicyV1beta1ClusterClient) Evictions() EvictionClusterInterface { return &evictionsClusterInterface{clientCache: c.clientCache} } -func (c *PolicyV1beta1ClusterClient) PodSecurityPolicies() PodSecurityPolicyClusterInterface { - return &podSecurityPoliciesClusterInterface{clientCache: c.clientCache} -} - // NewForConfig creates a new PolicyV1beta1ClusterClient for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/resource/v1alpha2/fake/resource_client.go b/kubernetes/typed/resource/v1alpha2/fake/resource_client.go index 7a49d4d8f..9634c142a 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/fake/resource_client.go @@ -60,6 +60,18 @@ func (c *ResourceV1alpha2ClusterClient) ResourceClaimTemplates() kcpresourcev1al return &resourceClaimTemplatesClusterClient{Fake: c.Fake} } +func (c *ResourceV1alpha2ClusterClient) ResourceSlices() kcpresourcev1alpha2.ResourceSliceClusterInterface { + return &resourceSlicesClusterClient{Fake: c.Fake} +} + +func (c *ResourceV1alpha2ClusterClient) ResourceClaimParameters() kcpresourcev1alpha2.ResourceClaimParametersClusterInterface { + return &resourceClaimParametersClusterClient{Fake: c.Fake} +} + +func (c *ResourceV1alpha2ClusterClient) ResourceClassParameters() kcpresourcev1alpha2.ResourceClassParametersClusterInterface { + return &resourceClassParametersClusterClient{Fake: c.Fake} +} + var _ resourcev1alpha2.ResourceV1alpha2Interface = (*ResourceV1alpha2Client)(nil) type ResourceV1alpha2Client struct { @@ -87,3 +99,15 @@ func (c *ResourceV1alpha2Client) ResourceClasses() resourcev1alpha2.ResourceClas func (c *ResourceV1alpha2Client) ResourceClaimTemplates(namespace string) resourcev1alpha2.ResourceClaimTemplateInterface { return &resourceClaimTemplatesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } + +func (c *ResourceV1alpha2Client) ResourceSlices() resourcev1alpha2.ResourceSliceInterface { + return &resourceSlicesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} + +func (c *ResourceV1alpha2Client) ResourceClaimParameters(namespace string) resourcev1alpha2.ResourceClaimParametersInterface { + return &resourceClaimParametersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} +} + +func (c *ResourceV1alpha2Client) ResourceClassParameters(namespace string) resourcev1alpha2.ResourceClassParametersInterface { + return &resourceClassParametersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/fake/resourceclaimparameters.go new file mode 100644 index 000000000..b35bfeaf9 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/resourceclaimparameters.go @@ -0,0 +1,213 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + "k8s.io/client-go/testing" + + kcpresourcev1alpha2 "github.com/kcp-dev/client-go/kubernetes/typed/resource/v1alpha2" + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var resourceClaimParametersResource = schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha2", Resource: "resourceclaimparameters"} +var resourceClaimParametersKind = schema.GroupVersionKind{Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaimParameters"} + +type resourceClaimParametersClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceClaimParametersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpresourcev1alpha2.ResourceClaimParametersNamespacer { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &resourceClaimParametersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors across all clusters. +func (c *resourceClaimParametersClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClaimParametersList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceClaimParametersResource, resourceClaimParametersKind, logicalcluster.Wildcard, metav1.NamespaceAll, opts), &resourcev1alpha2.ResourceClaimParametersList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceClaimParametersList{ListMeta: obj.(*resourcev1alpha2.ResourceClaimParametersList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceClaimParametersList).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 ResourceClaimParameters across all clusters. +func (c *resourceClaimParametersClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceClaimParametersResource, logicalcluster.Wildcard, metav1.NamespaceAll, opts)) +} + +type resourceClaimParametersNamespacer struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (n *resourceClaimParametersNamespacer) Namespace(namespace string) resourcev1alpha2client.ResourceClaimParametersInterface { + return &resourceClaimParametersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} +} + +type resourceClaimParametersClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path + Namespace string +} + +func (c *resourceClaimParametersClient) Create(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, opts metav1.CreateOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, resourceClaimParameters), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +func (c *resourceClaimParametersClient) Update(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, resourceClaimParameters), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +func (c *resourceClaimParametersClient) UpdateStatus(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(resourceClaimParametersResource, c.ClusterPath, "status", c.Namespace, resourceClaimParameters), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +func (c *resourceClaimParametersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(resourceClaimParametersResource, c.ClusterPath, c.Namespace, name, opts), &resourcev1alpha2.ResourceClaimParameters{}) + return err +} + +func (c *resourceClaimParametersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewDeleteCollectionAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, listOpts) + + _, err := c.Fake.Invokes(action, &resourcev1alpha2.ResourceClaimParametersList{}) + return err +} + +func (c *resourceClaimParametersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, name), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. +func (c *resourceClaimParametersClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClaimParametersList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceClaimParametersResource, resourceClaimParametersKind, c.ClusterPath, c.Namespace, opts), &resourcev1alpha2.ResourceClaimParametersList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceClaimParametersList{ListMeta: obj.(*resourcev1alpha2.ResourceClaimParametersList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceClaimParametersList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *resourceClaimParametersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, opts)) +} + +func (c *resourceClaimParametersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*resourcev1alpha2.ResourceClaimParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +func (c *resourceClaimParametersClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} + +func (c *resourceClaimParametersClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceClaimParameters, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClaimParametersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &resourcev1alpha2.ResourceClaimParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), err +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/fake/resourceclassparameters.go new file mode 100644 index 000000000..6c2f50f3d --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/resourceclassparameters.go @@ -0,0 +1,213 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + "k8s.io/client-go/testing" + + kcpresourcev1alpha2 "github.com/kcp-dev/client-go/kubernetes/typed/resource/v1alpha2" + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var resourceClassParametersResource = schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha2", Resource: "resourceclassparameters"} +var resourceClassParametersKind = schema.GroupVersionKind{Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClassParameters"} + +type resourceClassParametersClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceClassParametersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpresourcev1alpha2.ResourceClassParametersNamespacer { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &resourceClassParametersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors across all clusters. +func (c *resourceClassParametersClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClassParametersList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceClassParametersResource, resourceClassParametersKind, logicalcluster.Wildcard, metav1.NamespaceAll, opts), &resourcev1alpha2.ResourceClassParametersList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceClassParametersList{ListMeta: obj.(*resourcev1alpha2.ResourceClassParametersList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceClassParametersList).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 ResourceClassParameters across all clusters. +func (c *resourceClassParametersClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceClassParametersResource, logicalcluster.Wildcard, metav1.NamespaceAll, opts)) +} + +type resourceClassParametersNamespacer struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (n *resourceClassParametersNamespacer) Namespace(namespace string) resourcev1alpha2client.ResourceClassParametersInterface { + return &resourceClassParametersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} +} + +type resourceClassParametersClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path + Namespace string +} + +func (c *resourceClassParametersClient) Create(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParameters, opts metav1.CreateOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, resourceClassParameters), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +func (c *resourceClassParametersClient) Update(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParameters, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, resourceClassParameters), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +func (c *resourceClassParametersClient) UpdateStatus(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParameters, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(resourceClassParametersResource, c.ClusterPath, "status", c.Namespace, resourceClassParameters), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +func (c *resourceClassParametersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(resourceClassParametersResource, c.ClusterPath, c.Namespace, name, opts), &resourcev1alpha2.ResourceClassParameters{}) + return err +} + +func (c *resourceClassParametersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewDeleteCollectionAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, listOpts) + + _, err := c.Fake.Invokes(action, &resourcev1alpha2.ResourceClassParametersList{}) + return err +} + +func (c *resourceClassParametersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, name), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. +func (c *resourceClassParametersClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClassParametersList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceClassParametersResource, resourceClassParametersKind, c.ClusterPath, c.Namespace, opts), &resourcev1alpha2.ResourceClassParametersList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceClassParametersList{ListMeta: obj.(*resourcev1alpha2.ResourceClassParametersList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceClassParametersList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *resourceClassParametersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, opts)) +} + +func (c *resourceClassParametersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*resourcev1alpha2.ResourceClassParameters, error) { + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +func (c *resourceClassParametersClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceClassParametersApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} + +func (c *resourceClassParametersClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceClassParametersApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceClassParameters, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceClassParametersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &resourcev1alpha2.ResourceClassParameters{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceClassParameters), err +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/resourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/resourceslice.go new file mode 100644 index 000000000..e11a281cd --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/resourceslice.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var resourceSlicesResource = schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha2", Resource: "resourceslices"} +var resourceSlicesKind = schema.GroupVersionKind{Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceSlice"} + +type resourceSlicesClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceSlicesClusterClient) Cluster(clusterPath logicalcluster.Path) resourcev1alpha2client.ResourceSliceInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &resourceSlicesClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of ResourceSlices that match those selectors across all clusters. +func (c *resourceSlicesClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceSliceList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(resourceSlicesResource, resourceSlicesKind, logicalcluster.Wildcard, opts), &resourcev1alpha2.ResourceSliceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceSliceList{ListMeta: obj.(*resourcev1alpha2.ResourceSliceList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceSliceList).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 ResourceSlices across all clusters. +func (c *resourceSlicesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(resourceSlicesResource, logicalcluster.Wildcard, opts)) +} + +type resourceSlicesClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *resourceSlicesClient) Create(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSlice, opts metav1.CreateOptions) (*resourcev1alpha2.ResourceSlice, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(resourceSlicesResource, c.ClusterPath, resourceSlice), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +func (c *resourceSlicesClient) Update(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSlice, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceSlice, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(resourceSlicesResource, c.ClusterPath, resourceSlice), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +func (c *resourceSlicesClient) UpdateStatus(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSlice, opts metav1.UpdateOptions) (*resourcev1alpha2.ResourceSlice, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(resourceSlicesResource, c.ClusterPath, "status", resourceSlice), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +func (c *resourceSlicesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(resourceSlicesResource, c.ClusterPath, name, opts), &resourcev1alpha2.ResourceSlice{}) + return err +} + +func (c *resourceSlicesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(resourceSlicesResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &resourcev1alpha2.ResourceSliceList{}) + return err +} + +func (c *resourceSlicesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*resourcev1alpha2.ResourceSlice, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(resourceSlicesResource, c.ClusterPath, name), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +// List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. +func (c *resourceSlicesClient) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceSliceList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(resourceSlicesResource, resourceSlicesKind, c.ClusterPath, opts), &resourcev1alpha2.ResourceSliceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &resourcev1alpha2.ResourceSliceList{ListMeta: obj.(*resourcev1alpha2.ResourceSliceList).ListMeta} + for _, item := range obj.(*resourcev1alpha2.ResourceSliceList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *resourceSlicesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(resourceSlicesResource, c.ClusterPath, opts)) +} + +func (c *resourceSlicesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*resourcev1alpha2.ResourceSlice, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(resourceSlicesResource, c.ClusterPath, name, pt, data, subresources...), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +func (c *resourceSlicesClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceSliceApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceSlice, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(resourceSlicesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} + +func (c *resourceSlicesClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsresourcev1alpha2.ResourceSliceApplyConfiguration, opts metav1.ApplyOptions) (*resourcev1alpha2.ResourceSlice, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(resourceSlicesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &resourcev1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*resourcev1alpha2.ResourceSlice), err +} diff --git a/kubernetes/typed/resource/v1alpha2/resource_client.go b/kubernetes/typed/resource/v1alpha2/resource_client.go index df1c0e366..aece24fe2 100644 --- a/kubernetes/typed/resource/v1alpha2/resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/resource_client.go @@ -37,6 +37,9 @@ type ResourceV1alpha2ClusterInterface interface { PodSchedulingContextsClusterGetter ResourceClassesClusterGetter ResourceClaimTemplatesClusterGetter + ResourceSlicesClusterGetter + ResourceClaimParametersClusterGetter + ResourceClassParametersClusterGetter } type ResourceV1alpha2ClusterScoper interface { @@ -70,6 +73,18 @@ func (c *ResourceV1alpha2ClusterClient) ResourceClaimTemplates() ResourceClaimTe return &resourceClaimTemplatesClusterInterface{clientCache: c.clientCache} } +func (c *ResourceV1alpha2ClusterClient) ResourceSlices() ResourceSliceClusterInterface { + return &resourceSlicesClusterInterface{clientCache: c.clientCache} +} + +func (c *ResourceV1alpha2ClusterClient) ResourceClaimParameters() ResourceClaimParametersClusterInterface { + return &resourceClaimParametersClusterInterface{clientCache: c.clientCache} +} + +func (c *ResourceV1alpha2ClusterClient) ResourceClassParameters() ResourceClassParametersClusterInterface { + return &resourceClassParametersClusterInterface{clientCache: c.clientCache} +} + // NewForConfig creates a new ResourceV1alpha2ClusterClient for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..90968b4ec --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go @@ -0,0 +1,85 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" +) + +// ResourceClaimParametersClusterGetter has a method to return a ResourceClaimParametersClusterInterface. +// A group's cluster client should implement this interface. +type ResourceClaimParametersClusterGetter interface { + ResourceClaimParameters() ResourceClaimParametersClusterInterface +} + +// ResourceClaimParametersClusterInterface can operate on ResourceClaimParameters across all clusters, +// or scope down to one cluster and return a ResourceClaimParametersNamespacer. +type ResourceClaimParametersClusterInterface interface { + Cluster(logicalcluster.Path) ResourceClaimParametersNamespacer + List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClaimParametersList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type resourceClaimParametersClusterInterface struct { + clientCache kcpclient.Cache[*resourcev1alpha2client.ResourceV1alpha2Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceClaimParametersClusterInterface) Cluster(clusterPath logicalcluster.Path) ResourceClaimParametersNamespacer { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &resourceClaimParametersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} +} + +// List returns the entire collection of all ResourceClaimParameters across all clusters. +func (c *resourceClaimParametersClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClaimParametersList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceClaimParameters(metav1.NamespaceAll).List(ctx, opts) +} + +// Watch begins to watch all ResourceClaimParameters across all clusters. +func (c *resourceClaimParametersClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceClaimParameters(metav1.NamespaceAll).Watch(ctx, opts) +} + +// ResourceClaimParametersNamespacer can scope to objects within a namespace, returning a resourcev1alpha2client.ResourceClaimParametersInterface. +type ResourceClaimParametersNamespacer interface { + Namespace(string) resourcev1alpha2client.ResourceClaimParametersInterface +} + +type resourceClaimParametersNamespacer struct { + clientCache kcpclient.Cache[*resourcev1alpha2client.ResourceV1alpha2Client] + clusterPath logicalcluster.Path +} + +func (n *resourceClaimParametersNamespacer) Namespace(namespace string) resourcev1alpha2client.ResourceClaimParametersInterface { + return n.clientCache.ClusterOrDie(n.clusterPath).ResourceClaimParameters(namespace) +} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..e2f9c5e54 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go @@ -0,0 +1,85 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" +) + +// ResourceClassParametersClusterGetter has a method to return a ResourceClassParametersClusterInterface. +// A group's cluster client should implement this interface. +type ResourceClassParametersClusterGetter interface { + ResourceClassParameters() ResourceClassParametersClusterInterface +} + +// ResourceClassParametersClusterInterface can operate on ResourceClassParameters across all clusters, +// or scope down to one cluster and return a ResourceClassParametersNamespacer. +type ResourceClassParametersClusterInterface interface { + Cluster(logicalcluster.Path) ResourceClassParametersNamespacer + List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClassParametersList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type resourceClassParametersClusterInterface struct { + clientCache kcpclient.Cache[*resourcev1alpha2client.ResourceV1alpha2Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceClassParametersClusterInterface) Cluster(clusterPath logicalcluster.Path) ResourceClassParametersNamespacer { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &resourceClassParametersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} +} + +// List returns the entire collection of all ResourceClassParameters across all clusters. +func (c *resourceClassParametersClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceClassParametersList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceClassParameters(metav1.NamespaceAll).List(ctx, opts) +} + +// Watch begins to watch all ResourceClassParameters across all clusters. +func (c *resourceClassParametersClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceClassParameters(metav1.NamespaceAll).Watch(ctx, opts) +} + +// ResourceClassParametersNamespacer can scope to objects within a namespace, returning a resourcev1alpha2client.ResourceClassParametersInterface. +type ResourceClassParametersNamespacer interface { + Namespace(string) resourcev1alpha2client.ResourceClassParametersInterface +} + +type resourceClassParametersNamespacer struct { + clientCache kcpclient.Cache[*resourcev1alpha2client.ResourceV1alpha2Client] + clusterPath logicalcluster.Path +} + +func (n *resourceClassParametersNamespacer) Namespace(namespace string) resourcev1alpha2client.ResourceClassParametersInterface { + return n.clientCache.ClusterOrDie(n.clusterPath).ResourceClassParameters(namespace) +} diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha2/resourceslice.go new file mode 100644 index 000000000..07c324114 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceslice.go @@ -0,0 +1,71 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + resourcev1alpha2client "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" +) + +// ResourceSlicesClusterGetter has a method to return a ResourceSliceClusterInterface. +// A group's cluster client should implement this interface. +type ResourceSlicesClusterGetter interface { + ResourceSlices() ResourceSliceClusterInterface +} + +// ResourceSliceClusterInterface can operate on ResourceSlices across all clusters, +// or scope down to one cluster and return a resourcev1alpha2client.ResourceSliceInterface. +type ResourceSliceClusterInterface interface { + Cluster(logicalcluster.Path) resourcev1alpha2client.ResourceSliceInterface + List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceSliceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type resourceSlicesClusterInterface struct { + clientCache kcpclient.Cache[*resourcev1alpha2client.ResourceV1alpha2Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *resourceSlicesClusterInterface) Cluster(clusterPath logicalcluster.Path) resourcev1alpha2client.ResourceSliceInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return c.clientCache.ClusterOrDie(clusterPath).ResourceSlices() +} + +// List returns the entire collection of all ResourceSlices across all clusters. +func (c *resourceSlicesClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*resourcev1alpha2.ResourceSliceList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceSlices().List(ctx, opts) +} + +// Watch begins to watch all ResourceSlices across all clusters. +func (c *resourceSlicesClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).ResourceSlices().Watch(ctx, opts) +} diff --git a/kubernetes/typed/storage/v1alpha1/fake/storage_client.go b/kubernetes/typed/storage/v1alpha1/fake/storage_client.go index ac57d3056..f61f006fe 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/storage_client.go +++ b/kubernetes/typed/storage/v1alpha1/fake/storage_client.go @@ -52,6 +52,10 @@ func (c *StorageV1alpha1ClusterClient) CSIStorageCapacities() kcpstoragev1alpha1 return &cSIStorageCapacitiesClusterClient{Fake: c.Fake} } +func (c *StorageV1alpha1ClusterClient) VolumeAttributesClasses() kcpstoragev1alpha1.VolumeAttributesClassClusterInterface { + return &volumeAttributesClassesClusterClient{Fake: c.Fake} +} + var _ storagev1alpha1.StorageV1alpha1Interface = (*StorageV1alpha1Client)(nil) type StorageV1alpha1Client struct { @@ -71,3 +75,7 @@ func (c *StorageV1alpha1Client) VolumeAttachments() storagev1alpha1.VolumeAttach func (c *StorageV1alpha1Client) CSIStorageCapacities(namespace string) storagev1alpha1.CSIStorageCapacityInterface { return &cSIStorageCapacitiesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } + +func (c *StorageV1alpha1Client) VolumeAttributesClasses() storagev1alpha1.VolumeAttributesClassInterface { + return &volumeAttributesClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} diff --git a/kubernetes/typed/storage/v1alpha1/fake/volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/fake/volumeattributesclass.go new file mode 100644 index 000000000..94d5c245f --- /dev/null +++ b/kubernetes/typed/storage/v1alpha1/fake/volumeattributesclass.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + storagev1alpha1 "k8s.io/api/storage/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" + storagev1alpha1client "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var volumeAttributesClassesResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1alpha1", Resource: "volumeattributesclasses"} +var volumeAttributesClassesKind = schema.GroupVersionKind{Group: "storage.k8s.io", Version: "v1alpha1", Kind: "VolumeAttributesClass"} + +type volumeAttributesClassesClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *volumeAttributesClassesClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1alpha1client.VolumeAttributesClassInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &volumeAttributesClassesClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors across all clusters. +func (c *volumeAttributesClassesClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttributesClassList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttributesClassesResource, volumeAttributesClassesKind, logicalcluster.Wildcard, opts), &storagev1alpha1.VolumeAttributesClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &storagev1alpha1.VolumeAttributesClassList{ListMeta: obj.(*storagev1alpha1.VolumeAttributesClassList).ListMeta} + for _, item := range obj.(*storagev1alpha1.VolumeAttributesClassList).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 VolumeAttributesClasses across all clusters. +func (c *volumeAttributesClassesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttributesClassesResource, logicalcluster.Wildcard, opts)) +} + +type volumeAttributesClassesClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *volumeAttributesClassesClient) Create(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClass, opts metav1.CreateOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttributesClassesResource, c.ClusterPath, volumeAttributesClass), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +func (c *volumeAttributesClassesClient) Update(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClass, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttributesClassesResource, c.ClusterPath, volumeAttributesClass), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +func (c *volumeAttributesClassesClient) UpdateStatus(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClass, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttributesClassesResource, c.ClusterPath, "status", volumeAttributesClass), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +func (c *volumeAttributesClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttributesClassesResource, c.ClusterPath, name, opts), &storagev1alpha1.VolumeAttributesClass{}) + return err +} + +func (c *volumeAttributesClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(volumeAttributesClassesResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &storagev1alpha1.VolumeAttributesClassList{}) + return err +} + +func (c *volumeAttributesClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttributesClassesResource, c.ClusterPath, name), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. +func (c *volumeAttributesClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttributesClassList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttributesClassesResource, volumeAttributesClassesKind, c.ClusterPath, opts), &storagev1alpha1.VolumeAttributesClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &storagev1alpha1.VolumeAttributesClassList{ListMeta: obj.(*storagev1alpha1.VolumeAttributesClassList).ListMeta} + for _, item := range obj.(*storagev1alpha1.VolumeAttributesClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *volumeAttributesClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttributesClassesResource, c.ClusterPath, opts)) +} + +func (c *volumeAttributesClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1alpha1.VolumeAttributesClass, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttributesClassesResource, c.ClusterPath, name, pt, data, subresources...), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +func (c *volumeAttributesClassesClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsstoragev1alpha1.VolumeAttributesClassApplyConfiguration, opts metav1.ApplyOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttributesClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} + +func (c *volumeAttributesClassesClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsstoragev1alpha1.VolumeAttributesClassApplyConfiguration, opts metav1.ApplyOptions) (*storagev1alpha1.VolumeAttributesClass, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttributesClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1alpha1.VolumeAttributesClass{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1alpha1.VolumeAttributesClass), err +} diff --git a/kubernetes/typed/storage/v1alpha1/storage_client.go b/kubernetes/typed/storage/v1alpha1/storage_client.go index 034d48373..2a4c901d9 100644 --- a/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -35,6 +35,7 @@ type StorageV1alpha1ClusterInterface interface { StorageV1alpha1ClusterScoper VolumeAttachmentsClusterGetter CSIStorageCapacitiesClusterGetter + VolumeAttributesClassesClusterGetter } type StorageV1alpha1ClusterScoper interface { @@ -60,6 +61,10 @@ func (c *StorageV1alpha1ClusterClient) CSIStorageCapacities() CSIStorageCapacity return &cSIStorageCapacitiesClusterInterface{clientCache: c.clientCache} } +func (c *StorageV1alpha1ClusterClient) VolumeAttributesClasses() VolumeAttributesClassClusterInterface { + return &volumeAttributesClassesClusterInterface{clientCache: c.clientCache} +} + // NewForConfig creates a new StorageV1alpha1ClusterClient for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go new file mode 100644 index 000000000..f4536e396 --- /dev/null +++ b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go @@ -0,0 +1,71 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + storagev1alpha1 "k8s.io/api/storage/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + storagev1alpha1client "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" +) + +// VolumeAttributesClassesClusterGetter has a method to return a VolumeAttributesClassClusterInterface. +// A group's cluster client should implement this interface. +type VolumeAttributesClassesClusterGetter interface { + VolumeAttributesClasses() VolumeAttributesClassClusterInterface +} + +// VolumeAttributesClassClusterInterface can operate on VolumeAttributesClasses across all clusters, +// or scope down to one cluster and return a storagev1alpha1client.VolumeAttributesClassInterface. +type VolumeAttributesClassClusterInterface interface { + Cluster(logicalcluster.Path) storagev1alpha1client.VolumeAttributesClassInterface + List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttributesClassList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type volumeAttributesClassesClusterInterface struct { + clientCache kcpclient.Cache[*storagev1alpha1client.StorageV1alpha1Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *volumeAttributesClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1alpha1client.VolumeAttributesClassInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return c.clientCache.ClusterOrDie(clusterPath).VolumeAttributesClasses() +} + +// List returns the entire collection of all VolumeAttributesClasses across all clusters. +func (c *volumeAttributesClassesClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttributesClassList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).VolumeAttributesClasses().List(ctx, opts) +} + +// Watch begins to watch all VolumeAttributesClasses across all clusters. +func (c *volumeAttributesClassesClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).VolumeAttributesClasses().Watch(ctx, opts) +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/fake/storagemigration_client.go b/kubernetes/typed/storagemigration/v1alpha1/fake/storagemigration_client.go new file mode 100644 index 000000000..89fdc291e --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/storagemigration_client.go @@ -0,0 +1,65 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" + "k8s.io/client-go/rest" + + kcpstoragemigrationv1alpha1 "github.com/kcp-dev/client-go/kubernetes/typed/storagemigration/v1alpha1" + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var _ kcpstoragemigrationv1alpha1.StoragemigrationV1alpha1ClusterInterface = (*StoragemigrationV1alpha1ClusterClient)(nil) + +type StoragemigrationV1alpha1ClusterClient struct { + *kcptesting.Fake +} + +func (c *StoragemigrationV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + return &StoragemigrationV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} +} + +func (c *StoragemigrationV1alpha1ClusterClient) StorageVersionMigrations() kcpstoragemigrationv1alpha1.StorageVersionMigrationClusterInterface { + return &storageVersionMigrationsClusterClient{Fake: c.Fake} +} + +var _ storagemigrationv1alpha1.StoragemigrationV1alpha1Interface = (*StoragemigrationV1alpha1Client)(nil) + +type StoragemigrationV1alpha1Client struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *StoragemigrationV1alpha1Client) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} + +func (c *StoragemigrationV1alpha1Client) StorageVersionMigrations() storagemigrationv1alpha1.StorageVersionMigrationInterface { + return &storageVersionMigrationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/fake/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/fake/storageversionmigration.go new file mode 100644 index 000000000..9867a25f2 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/storageversionmigration.go @@ -0,0 +1,202 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package fake + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" + storagemigrationv1alpha1client "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" + "k8s.io/client-go/testing" + + kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing" +) + +var storageVersionMigrationsResource = schema.GroupVersionResource{Group: "storagemigration.k8s.io", Version: "v1alpha1", Resource: "storageversionmigrations"} +var storageVersionMigrationsKind = schema.GroupVersionKind{Group: "storagemigration.k8s.io", Version: "v1alpha1", Kind: "StorageVersionMigration"} + +type storageVersionMigrationsClusterClient struct { + *kcptesting.Fake +} + +// Cluster scopes the client down to a particular cluster. +func (c *storageVersionMigrationsClusterClient) Cluster(clusterPath logicalcluster.Path) storagemigrationv1alpha1client.StorageVersionMigrationInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return &storageVersionMigrationsClient{Fake: c.Fake, ClusterPath: clusterPath} +} + +// List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors across all clusters. +func (c *storageVersionMigrationsClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*storagemigrationv1alpha1.StorageVersionMigrationList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageVersionMigrationsResource, storageVersionMigrationsKind, logicalcluster.Wildcard, opts), &storagemigrationv1alpha1.StorageVersionMigrationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &storagemigrationv1alpha1.StorageVersionMigrationList{ListMeta: obj.(*storagemigrationv1alpha1.StorageVersionMigrationList).ListMeta} + for _, item := range obj.(*storagemigrationv1alpha1.StorageVersionMigrationList).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 StorageVersionMigrations across all clusters. +func (c *storageVersionMigrationsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageVersionMigrationsResource, logicalcluster.Wildcard, opts)) +} + +type storageVersionMigrationsClient struct { + *kcptesting.Fake + ClusterPath logicalcluster.Path +} + +func (c *storageVersionMigrationsClient) Create(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, opts metav1.CreateOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageVersionMigrationsResource, c.ClusterPath, storageVersionMigration), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +func (c *storageVersionMigrationsClient) Update(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, opts metav1.UpdateOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageVersionMigrationsResource, c.ClusterPath, storageVersionMigration), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +func (c *storageVersionMigrationsClient) UpdateStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, opts metav1.UpdateOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageVersionMigrationsResource, c.ClusterPath, "status", storageVersionMigration), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +func (c *storageVersionMigrationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageVersionMigrationsResource, c.ClusterPath, name, opts), &storagemigrationv1alpha1.StorageVersionMigration{}) + return err +} + +func (c *storageVersionMigrationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := kcptesting.NewRootDeleteCollectionAction(storageVersionMigrationsResource, c.ClusterPath, listOpts) + + _, err := c.Fake.Invokes(action, &storagemigrationv1alpha1.StorageVersionMigrationList{}) + return err +} + +func (c *storageVersionMigrationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageVersionMigrationsResource, c.ClusterPath, name), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +// List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. +func (c *storageVersionMigrationsClient) List(ctx context.Context, opts metav1.ListOptions) (*storagemigrationv1alpha1.StorageVersionMigrationList, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageVersionMigrationsResource, storageVersionMigrationsKind, c.ClusterPath, opts), &storagemigrationv1alpha1.StorageVersionMigrationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &storagemigrationv1alpha1.StorageVersionMigrationList{ListMeta: obj.(*storagemigrationv1alpha1.StorageVersionMigrationList).ListMeta} + for _, item := range obj.(*storagemigrationv1alpha1.StorageVersionMigrationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +func (c *storageVersionMigrationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageVersionMigrationsResource, c.ClusterPath, opts)) +} + +func (c *storageVersionMigrationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionMigrationsResource, c.ClusterPath, name, pt, data, subresources...), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +func (c *storageVersionMigrationsClient) Apply(ctx context.Context, applyConfiguration *applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts metav1.ApplyOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionMigrationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} + +func (c *storageVersionMigrationsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts metav1.ApplyOptions) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + if applyConfiguration == nil { + return nil, fmt.Errorf("applyConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(applyConfiguration) + if err != nil { + return nil, err + } + name := applyConfiguration.Name + if name == nil { + return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionMigrationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagemigrationv1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), err +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go b/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go new file mode 100644 index 000000000..16ac624c3 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go @@ -0,0 +1,89 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" + "k8s.io/client-go/rest" +) + +type StoragemigrationV1alpha1ClusterInterface interface { + StoragemigrationV1alpha1ClusterScoper + StorageVersionMigrationsClusterGetter +} + +type StoragemigrationV1alpha1ClusterScoper interface { + Cluster(logicalcluster.Path) storagemigrationv1alpha1.StoragemigrationV1alpha1Interface +} + +type StoragemigrationV1alpha1ClusterClient struct { + clientCache kcpclient.Cache[*storagemigrationv1alpha1.StoragemigrationV1alpha1Client] +} + +func (c *StoragemigrationV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + return c.clientCache.ClusterOrDie(clusterPath) +} + +func (c *StoragemigrationV1alpha1ClusterClient) StorageVersionMigrations() StorageVersionMigrationClusterInterface { + return &storageVersionMigrationsClusterInterface{clientCache: c.clientCache} +} + +// NewForConfig creates a new StoragemigrationV1alpha1ClusterClient for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*StoragemigrationV1alpha1ClusterClient, error) { + client, err := rest.HTTPClientFor(c) + if err != nil { + return nil, err + } + return NewForConfigAndClient(c, client) +} + +// NewForConfigAndClient creates a new StoragemigrationV1alpha1ClusterClient for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StoragemigrationV1alpha1ClusterClient, error) { + cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*storagemigrationv1alpha1.StoragemigrationV1alpha1Client]{ + NewForConfigAndClient: storagemigrationv1alpha1.NewForConfigAndClient, + }) + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { + return nil, err + } + return &StoragemigrationV1alpha1ClusterClient{clientCache: cache}, nil +} + +// NewForConfigOrDie creates a new StoragemigrationV1alpha1ClusterClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *StoragemigrationV1alpha1ClusterClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..022eb115e --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,71 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + storagemigrationv1alpha1client "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" +) + +// StorageVersionMigrationsClusterGetter has a method to return a StorageVersionMigrationClusterInterface. +// A group's cluster client should implement this interface. +type StorageVersionMigrationsClusterGetter interface { + StorageVersionMigrations() StorageVersionMigrationClusterInterface +} + +// StorageVersionMigrationClusterInterface can operate on StorageVersionMigrations across all clusters, +// or scope down to one cluster and return a storagemigrationv1alpha1client.StorageVersionMigrationInterface. +type StorageVersionMigrationClusterInterface interface { + Cluster(logicalcluster.Path) storagemigrationv1alpha1client.StorageVersionMigrationInterface + List(ctx context.Context, opts metav1.ListOptions) (*storagemigrationv1alpha1.StorageVersionMigrationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) +} + +type storageVersionMigrationsClusterInterface struct { + clientCache kcpclient.Cache[*storagemigrationv1alpha1client.StoragemigrationV1alpha1Client] +} + +// Cluster scopes the client down to a particular cluster. +func (c *storageVersionMigrationsClusterInterface) Cluster(clusterPath logicalcluster.Path) storagemigrationv1alpha1client.StorageVersionMigrationInterface { + if clusterPath == logicalcluster.Wildcard { + panic("A specific cluster must be provided when scoping, not the wildcard.") + } + + return c.clientCache.ClusterOrDie(clusterPath).StorageVersionMigrations() +} + +// List returns the entire collection of all StorageVersionMigrations across all clusters. +func (c *storageVersionMigrationsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*storagemigrationv1alpha1.StorageVersionMigrationList, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).StorageVersionMigrations().List(ctx, opts) +} + +// Watch begins to watch all StorageVersionMigrations across all clusters. +func (c *storageVersionMigrationsClusterInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.clientCache.ClusterOrDie(logicalcluster.Wildcard).StorageVersionMigrations().Watch(ctx, opts) +} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicy.go b/listers/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..a6a1faebe --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + admissionregistrationv1listers "k8s.io/client-go/listers/admissionregistration/v1" + "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyClusterLister can list ValidatingAdmissionPolicies across all workspaces, or scope down to a ValidatingAdmissionPolicyLister for one workspace. +// All objects returned here must be treated as read-only. +type ValidatingAdmissionPolicyClusterLister interface { + // List lists all ValidatingAdmissionPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicy, err error) + // Cluster returns a lister that can list and get ValidatingAdmissionPolicies in one workspace. + Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingAdmissionPolicyLister + ValidatingAdmissionPolicyClusterListerExpansion +} + +type validatingAdmissionPolicyClusterLister struct { + indexer cache.Indexer +} + +// NewValidatingAdmissionPolicyClusterLister returns a new ValidatingAdmissionPolicyClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +func NewValidatingAdmissionPolicyClusterLister(indexer cache.Indexer) *validatingAdmissionPolicyClusterLister { + return &validatingAdmissionPolicyClusterLister{indexer: indexer} +} + +// List lists all ValidatingAdmissionPolicies in the indexer across all workspaces. +func (s *validatingAdmissionPolicyClusterLister) List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistrationv1.ValidatingAdmissionPolicy)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get ValidatingAdmissionPolicies. +func (s *validatingAdmissionPolicyClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingAdmissionPolicyLister { + return &validatingAdmissionPolicyLister{indexer: s.indexer, clusterName: clusterName} +} + +// validatingAdmissionPolicyLister implements the admissionregistrationv1listers.ValidatingAdmissionPolicyLister interface. +type validatingAdmissionPolicyLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all ValidatingAdmissionPolicies in the indexer for a workspace. +func (s *validatingAdmissionPolicyLister) List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicy, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*admissionregistrationv1.ValidatingAdmissionPolicy)) + }) + return ret, err +} + +// Get retrieves the ValidatingAdmissionPolicy from the indexer for a given workspace and name. +func (s *validatingAdmissionPolicyLister) Get(name string) (*admissionregistrationv1.ValidatingAdmissionPolicy, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(admissionregistrationv1.Resource("validatingadmissionpolicies"), name) + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicy), nil +} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicy_expansion.go b/listers/admissionregistration/v1/validatingadmissionpolicy_expansion.go new file mode 100644 index 000000000..29fbe81fa --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicy_expansion.go @@ -0,0 +1,25 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +// ValidatingAdmissionPolicyClusterListerExpansion allows custom methods to be added to ValidatingAdmissionPolicyClusterLister. +type ValidatingAdmissionPolicyClusterListerExpansion interface{} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicybinding.go b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..3e7c35fd6 --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + admissionregistrationv1listers "k8s.io/client-go/listers/admissionregistration/v1" + "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyBindingClusterLister can list ValidatingAdmissionPolicyBindings across all workspaces, or scope down to a ValidatingAdmissionPolicyBindingLister for one workspace. +// All objects returned here must be treated as read-only. +type ValidatingAdmissionPolicyBindingClusterLister interface { + // List lists all ValidatingAdmissionPolicyBindings in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicyBinding, err error) + // Cluster returns a lister that can list and get ValidatingAdmissionPolicyBindings in one workspace. + Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingAdmissionPolicyBindingLister + ValidatingAdmissionPolicyBindingClusterListerExpansion +} + +type validatingAdmissionPolicyBindingClusterLister struct { + indexer cache.Indexer +} + +// NewValidatingAdmissionPolicyBindingClusterLister returns a new ValidatingAdmissionPolicyBindingClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +func NewValidatingAdmissionPolicyBindingClusterLister(indexer cache.Indexer) *validatingAdmissionPolicyBindingClusterLister { + return &validatingAdmissionPolicyBindingClusterLister{indexer: indexer} +} + +// List lists all ValidatingAdmissionPolicyBindings in the indexer across all workspaces. +func (s *validatingAdmissionPolicyBindingClusterLister) List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicyBinding, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get ValidatingAdmissionPolicyBindings. +func (s *validatingAdmissionPolicyBindingClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingAdmissionPolicyBindingLister { + return &validatingAdmissionPolicyBindingLister{indexer: s.indexer, clusterName: clusterName} +} + +// validatingAdmissionPolicyBindingLister implements the admissionregistrationv1listers.ValidatingAdmissionPolicyBindingLister interface. +type validatingAdmissionPolicyBindingLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all ValidatingAdmissionPolicyBindings in the indexer for a workspace. +func (s *validatingAdmissionPolicyBindingLister) List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingAdmissionPolicyBinding, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding)) + }) + return ret, err +} + +// Get retrieves the ValidatingAdmissionPolicyBinding from the indexer for a given workspace and name. +func (s *validatingAdmissionPolicyBindingLister) Get(name string) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(admissionregistrationv1.Resource("validatingadmissionpolicybindings"), name) + } + return obj.(*admissionregistrationv1.ValidatingAdmissionPolicyBinding), nil +} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicybinding_expansion.go b/listers/admissionregistration/v1/validatingadmissionpolicybinding_expansion.go new file mode 100644 index 000000000..0adb47da3 --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicybinding_expansion.go @@ -0,0 +1,25 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1 + +// ValidatingAdmissionPolicyBindingClusterListerExpansion allows custom methods to be added to ValidatingAdmissionPolicyBindingClusterLister. +type ValidatingAdmissionPolicyBindingClusterListerExpansion interface{} diff --git a/listers/flowcontrol/v1alpha1/flowschema.go b/listers/flowcontrol/v1/flowschema.go similarity index 75% rename from listers/flowcontrol/v1alpha1/flowschema.go rename to listers/flowcontrol/v1/flowschema.go index f76bd5868..bd78edf97 100644 --- a/listers/flowcontrol/v1alpha1/flowschema.go +++ b/listers/flowcontrol/v1/flowschema.go @@ -19,16 +19,16 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" - flowcontrolv1alpha1listers "k8s.io/client-go/listers/flowcontrol/v1alpha1" + flowcontrolv1listers "k8s.io/client-go/listers/flowcontrol/v1" "k8s.io/client-go/tools/cache" ) @@ -37,9 +37,9 @@ import ( type FlowSchemaClusterLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*flowcontrolv1alpha1.FlowSchema, err error) + List(selector labels.Selector) (ret []*flowcontrolv1.FlowSchema, err error) // Cluster returns a lister that can list and get FlowSchemas in one workspace. - Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1listers.FlowSchemaLister FlowSchemaClusterListerExpansion } @@ -57,41 +57,41 @@ func NewFlowSchemaClusterLister(indexer cache.Indexer) *flowSchemaClusterLister } // List lists all FlowSchemas in the indexer across all workspaces. -func (s *flowSchemaClusterLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.FlowSchema, err error) { +func (s *flowSchemaClusterLister) List(selector labels.Selector) (ret []*flowcontrolv1.FlowSchema, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*flowcontrolv1alpha1.FlowSchema)) + ret = append(ret, m.(*flowcontrolv1.FlowSchema)) }) return ret, err } // Cluster scopes the lister to one workspace, allowing users to list and get FlowSchemas. -func (s *flowSchemaClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister { +func (s *flowSchemaClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1listers.FlowSchemaLister { return &flowSchemaLister{indexer: s.indexer, clusterName: clusterName} } -// flowSchemaLister implements the flowcontrolv1alpha1listers.FlowSchemaLister interface. +// flowSchemaLister implements the flowcontrolv1listers.FlowSchemaLister interface. type flowSchemaLister struct { indexer cache.Indexer clusterName logicalcluster.Name } // List lists all FlowSchemas in the indexer for a workspace. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.FlowSchema, err error) { +func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1.FlowSchema, err error) { err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { - ret = append(ret, i.(*flowcontrolv1alpha1.FlowSchema)) + ret = append(ret, i.(*flowcontrolv1.FlowSchema)) }) return ret, err } // Get retrieves the FlowSchema from the indexer for a given workspace and name. -func (s *flowSchemaLister) Get(name string) (*flowcontrolv1alpha1.FlowSchema, error) { +func (s *flowSchemaLister) Get(name string) (*flowcontrolv1.FlowSchema, error) { key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(flowcontrolv1alpha1.Resource("flowschemas"), name) + return nil, errors.NewNotFound(flowcontrolv1.Resource("flowschemas"), name) } - return obj.(*flowcontrolv1alpha1.FlowSchema), nil + return obj.(*flowcontrolv1.FlowSchema), nil } diff --git a/listers/flowcontrol/v1alpha1/flowschema_expansion.go b/listers/flowcontrol/v1/flowschema_expansion.go similarity index 97% rename from listers/flowcontrol/v1alpha1/flowschema_expansion.go rename to listers/flowcontrol/v1/flowschema_expansion.go index 4da91d226..daadff169 100644 --- a/listers/flowcontrol/v1alpha1/flowschema_expansion.go +++ b/listers/flowcontrol/v1/flowschema_expansion.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 // FlowSchemaClusterListerExpansion allows custom methods to be added to FlowSchemaClusterLister. type FlowSchemaClusterListerExpansion interface{} diff --git a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/listers/flowcontrol/v1/prioritylevelconfiguration.go similarity index 76% rename from listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go rename to listers/flowcontrol/v1/prioritylevelconfiguration.go index 9429d37fb..b005558e7 100644 --- a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1/prioritylevelconfiguration.go @@ -19,16 +19,16 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 import ( kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" "github.com/kcp-dev/logicalcluster/v3" - flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" - flowcontrolv1alpha1listers "k8s.io/client-go/listers/flowcontrol/v1alpha1" + flowcontrolv1listers "k8s.io/client-go/listers/flowcontrol/v1" "k8s.io/client-go/tools/cache" ) @@ -37,9 +37,9 @@ import ( type PriorityLevelConfigurationClusterLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*flowcontrolv1alpha1.PriorityLevelConfiguration, err error) + List(selector labels.Selector) (ret []*flowcontrolv1.PriorityLevelConfiguration, err error) // Cluster returns a lister that can list and get PriorityLevelConfigurations in one workspace. - Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1listers.PriorityLevelConfigurationLister PriorityLevelConfigurationClusterListerExpansion } @@ -57,41 +57,41 @@ func NewPriorityLevelConfigurationClusterLister(indexer cache.Indexer) *priority } // List lists all PriorityLevelConfigurations in the indexer across all workspaces. -func (s *priorityLevelConfigurationClusterLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.PriorityLevelConfiguration, err error) { +func (s *priorityLevelConfigurationClusterLister) List(selector labels.Selector) (ret []*flowcontrolv1.PriorityLevelConfiguration, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*flowcontrolv1alpha1.PriorityLevelConfiguration)) + ret = append(ret, m.(*flowcontrolv1.PriorityLevelConfiguration)) }) return ret, err } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityLevelConfigurations. -func (s *priorityLevelConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister { +func (s *priorityLevelConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1listers.PriorityLevelConfigurationLister { return &priorityLevelConfigurationLister{indexer: s.indexer, clusterName: clusterName} } -// priorityLevelConfigurationLister implements the flowcontrolv1alpha1listers.PriorityLevelConfigurationLister interface. +// priorityLevelConfigurationLister implements the flowcontrolv1listers.PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { indexer cache.Indexer clusterName logicalcluster.Name } // List lists all PriorityLevelConfigurations in the indexer for a workspace. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.PriorityLevelConfiguration, err error) { +func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*flowcontrolv1.PriorityLevelConfiguration, err error) { err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { - ret = append(ret, i.(*flowcontrolv1alpha1.PriorityLevelConfiguration)) + ret = append(ret, i.(*flowcontrolv1.PriorityLevelConfiguration)) }) return ret, err } // Get retrieves the PriorityLevelConfiguration from the indexer for a given workspace and name. -func (s *priorityLevelConfigurationLister) Get(name string) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { +func (s *priorityLevelConfigurationLister) Get(name string) (*flowcontrolv1.PriorityLevelConfiguration, error) { key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(flowcontrolv1alpha1.Resource("prioritylevelconfigurations"), name) + return nil, errors.NewNotFound(flowcontrolv1.Resource("prioritylevelconfigurations"), name) } - return obj.(*flowcontrolv1alpha1.PriorityLevelConfiguration), nil + return obj.(*flowcontrolv1.PriorityLevelConfiguration), nil } diff --git a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration_expansion.go b/listers/flowcontrol/v1/prioritylevelconfiguration_expansion.go similarity index 98% rename from listers/flowcontrol/v1alpha1/prioritylevelconfiguration_expansion.go rename to listers/flowcontrol/v1/prioritylevelconfiguration_expansion.go index 9179ae0d6..cd43625e2 100644 --- a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration_expansion.go +++ b/listers/flowcontrol/v1/prioritylevelconfiguration_expansion.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1alpha1 +package v1 // PriorityLevelConfigurationClusterListerExpansion allows custom methods to be added to PriorityLevelConfigurationClusterLister. type PriorityLevelConfigurationClusterListerExpansion interface{} diff --git a/listers/networking/v1alpha1/clustercidr.go b/listers/networking/v1alpha1/servicecidr.go similarity index 53% rename from listers/networking/v1alpha1/clustercidr.go rename to listers/networking/v1alpha1/servicecidr.go index ef9fa963f..ee888048d 100644 --- a/listers/networking/v1alpha1/clustercidr.go +++ b/listers/networking/v1alpha1/servicecidr.go @@ -32,66 +32,66 @@ import ( "k8s.io/client-go/tools/cache" ) -// ClusterCIDRClusterLister can list ClusterCIDRs across all workspaces, or scope down to a ClusterCIDRLister for one workspace. +// ServiceCIDRClusterLister can list ServiceCIDRs across all workspaces, or scope down to a ServiceCIDRLister for one workspace. // All objects returned here must be treated as read-only. -type ClusterCIDRClusterLister interface { - // List lists all ClusterCIDRs in the indexer. +type ServiceCIDRClusterLister interface { + // List lists all ServiceCIDRs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*networkingv1alpha1.ClusterCIDR, err error) - // Cluster returns a lister that can list and get ClusterCIDRs in one workspace. - Cluster(clusterName logicalcluster.Name) networkingv1alpha1listers.ClusterCIDRLister - ClusterCIDRClusterListerExpansion + List(selector labels.Selector) (ret []*networkingv1alpha1.ServiceCIDR, err error) + // Cluster returns a lister that can list and get ServiceCIDRs in one workspace. + Cluster(clusterName logicalcluster.Name) networkingv1alpha1listers.ServiceCIDRLister + ServiceCIDRClusterListerExpansion } -type clusterCIDRClusterLister struct { +type serviceCIDRClusterLister struct { indexer cache.Indexer } -// NewClusterCIDRClusterLister returns a new ClusterCIDRClusterLister. +// NewServiceCIDRClusterLister returns a new ServiceCIDRClusterLister. // We assume that the indexer: // - is fed by a cross-workspace LIST+WATCH // - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function // - has the kcpcache.ClusterIndex as an index -func NewClusterCIDRClusterLister(indexer cache.Indexer) *clusterCIDRClusterLister { - return &clusterCIDRClusterLister{indexer: indexer} +func NewServiceCIDRClusterLister(indexer cache.Indexer) *serviceCIDRClusterLister { + return &serviceCIDRClusterLister{indexer: indexer} } -// List lists all ClusterCIDRs in the indexer across all workspaces. -func (s *clusterCIDRClusterLister) List(selector labels.Selector) (ret []*networkingv1alpha1.ClusterCIDR, err error) { +// List lists all ServiceCIDRs in the indexer across all workspaces. +func (s *serviceCIDRClusterLister) List(selector labels.Selector) (ret []*networkingv1alpha1.ServiceCIDR, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*networkingv1alpha1.ClusterCIDR)) + ret = append(ret, m.(*networkingv1alpha1.ServiceCIDR)) }) return ret, err } -// Cluster scopes the lister to one workspace, allowing users to list and get ClusterCIDRs. -func (s *clusterCIDRClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1alpha1listers.ClusterCIDRLister { - return &clusterCIDRLister{indexer: s.indexer, clusterName: clusterName} +// Cluster scopes the lister to one workspace, allowing users to list and get ServiceCIDRs. +func (s *serviceCIDRClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1alpha1listers.ServiceCIDRLister { + return &serviceCIDRLister{indexer: s.indexer, clusterName: clusterName} } -// clusterCIDRLister implements the networkingv1alpha1listers.ClusterCIDRLister interface. -type clusterCIDRLister struct { +// serviceCIDRLister implements the networkingv1alpha1listers.ServiceCIDRLister interface. +type serviceCIDRLister struct { indexer cache.Indexer clusterName logicalcluster.Name } -// List lists all ClusterCIDRs in the indexer for a workspace. -func (s *clusterCIDRLister) List(selector labels.Selector) (ret []*networkingv1alpha1.ClusterCIDR, err error) { +// List lists all ServiceCIDRs in the indexer for a workspace. +func (s *serviceCIDRLister) List(selector labels.Selector) (ret []*networkingv1alpha1.ServiceCIDR, err error) { err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { - ret = append(ret, i.(*networkingv1alpha1.ClusterCIDR)) + ret = append(ret, i.(*networkingv1alpha1.ServiceCIDR)) }) return ret, err } -// Get retrieves the ClusterCIDR from the indexer for a given workspace and name. -func (s *clusterCIDRLister) Get(name string) (*networkingv1alpha1.ClusterCIDR, error) { +// Get retrieves the ServiceCIDR from the indexer for a given workspace and name. +func (s *serviceCIDRLister) Get(name string) (*networkingv1alpha1.ServiceCIDR, error) { key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(networkingv1alpha1.Resource("clustercidrs"), name) + return nil, errors.NewNotFound(networkingv1alpha1.Resource("servicecidrs"), name) } - return obj.(*networkingv1alpha1.ClusterCIDR), nil + return obj.(*networkingv1alpha1.ServiceCIDR), nil } diff --git a/listers/networking/v1alpha1/clustercidr_expansion.go b/listers/networking/v1alpha1/servicecidr_expansion.go similarity index 82% rename from listers/networking/v1alpha1/clustercidr_expansion.go rename to listers/networking/v1alpha1/servicecidr_expansion.go index 3c4e409dd..1c2513923 100644 --- a/listers/networking/v1alpha1/clustercidr_expansion.go +++ b/listers/networking/v1alpha1/servicecidr_expansion.go @@ -21,5 +21,5 @@ limitations under the License. package v1alpha1 -// ClusterCIDRClusterListerExpansion allows custom methods to be added to ClusterCIDRClusterLister. -type ClusterCIDRClusterListerExpansion interface{} +// ServiceCIDRClusterListerExpansion allows custom methods to be added to ServiceCIDRClusterLister. +type ServiceCIDRClusterListerExpansion interface{} diff --git a/listers/policy/v1beta1/podsecuritypolicy.go b/listers/policy/v1beta1/podsecuritypolicy.go deleted file mode 100644 index a1c8097b2..000000000 --- a/listers/policy/v1beta1/podsecuritypolicy.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The KCP 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 kcp code-generator. DO NOT EDIT. - -package v1beta1 - -import ( - kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" - "github.com/kcp-dev/logicalcluster/v3" - - policyv1beta1 "k8s.io/api/policy/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - policyv1beta1listers "k8s.io/client-go/listers/policy/v1beta1" - "k8s.io/client-go/tools/cache" -) - -// PodSecurityPolicyClusterLister can list PodSecurityPolicies across all workspaces, or scope down to a PodSecurityPolicyLister for one workspace. -// All objects returned here must be treated as read-only. -type PodSecurityPolicyClusterLister interface { - // List lists all PodSecurityPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*policyv1beta1.PodSecurityPolicy, err error) - // Cluster returns a lister that can list and get PodSecurityPolicies in one workspace. - Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister - PodSecurityPolicyClusterListerExpansion -} - -type podSecurityPolicyClusterLister struct { - indexer cache.Indexer -} - -// NewPodSecurityPolicyClusterLister returns a new PodSecurityPolicyClusterLister. -// We assume that the indexer: -// - is fed by a cross-workspace LIST+WATCH -// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function -// - has the kcpcache.ClusterIndex as an index -func NewPodSecurityPolicyClusterLister(indexer cache.Indexer) *podSecurityPolicyClusterLister { - return &podSecurityPolicyClusterLister{indexer: indexer} -} - -// List lists all PodSecurityPolicies in the indexer across all workspaces. -func (s *podSecurityPolicyClusterLister) List(selector labels.Selector) (ret []*policyv1beta1.PodSecurityPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*policyv1beta1.PodSecurityPolicy)) - }) - return ret, err -} - -// Cluster scopes the lister to one workspace, allowing users to list and get PodSecurityPolicies. -func (s *podSecurityPolicyClusterLister) Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister { - return &podSecurityPolicyLister{indexer: s.indexer, clusterName: clusterName} -} - -// podSecurityPolicyLister implements the policyv1beta1listers.PodSecurityPolicyLister interface. -type podSecurityPolicyLister struct { - indexer cache.Indexer - clusterName logicalcluster.Name -} - -// List lists all PodSecurityPolicies in the indexer for a workspace. -func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*policyv1beta1.PodSecurityPolicy, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { - ret = append(ret, i.(*policyv1beta1.PodSecurityPolicy)) - }) - return ret, err -} - -// Get retrieves the PodSecurityPolicy from the indexer for a given workspace and name. -func (s *podSecurityPolicyLister) Get(name string) (*policyv1beta1.PodSecurityPolicy, error) { - key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) - obj, exists, err := s.indexer.GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(policyv1beta1.Resource("podsecuritypolicies"), name) - } - return obj.(*policyv1beta1.PodSecurityPolicy), nil -} diff --git a/listers/resource/v1alpha2/resourceclaimparameters.go b/listers/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..88dd300dc --- /dev/null +++ b/listers/resource/v1alpha2/resourceclaimparameters.go @@ -0,0 +1,118 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + "k8s.io/client-go/tools/cache" +) + +// ResourceClaimParametersClusterLister can list ResourceClaimParameters across all workspaces, or scope down to a ResourceClaimParametersLister for one workspace. +// All objects returned here must be treated as read-only. +type ResourceClaimParametersClusterLister interface { + // List lists all ResourceClaimParameters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClaimParameters, err error) + // Cluster returns a lister that can list and get ResourceClaimParameters in one workspace. + Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceClaimParametersLister + ResourceClaimParametersClusterListerExpansion +} + +type resourceClaimParametersClusterLister struct { + indexer cache.Indexer +} + +// NewResourceClaimParametersClusterLister returns a new ResourceClaimParametersClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +// - has the kcpcache.ClusterAndNamespaceIndex as an index +func NewResourceClaimParametersClusterLister(indexer cache.Indexer) *resourceClaimParametersClusterLister { + return &resourceClaimParametersClusterLister{indexer: indexer} +} + +// List lists all ResourceClaimParameters in the indexer across all workspaces. +func (s *resourceClaimParametersClusterLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClaimParameters, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*resourcev1alpha2.ResourceClaimParameters)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get ResourceClaimParameters. +func (s *resourceClaimParametersClusterLister) Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceClaimParametersLister { + return &resourceClaimParametersLister{indexer: s.indexer, clusterName: clusterName} +} + +// resourceClaimParametersLister implements the resourcev1alpha2listers.ResourceClaimParametersLister interface. +type resourceClaimParametersLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all ResourceClaimParameters in the indexer for a workspace. +func (s *resourceClaimParametersLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClaimParameters, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*resourcev1alpha2.ResourceClaimParameters)) + }) + return ret, err +} + +// ResourceClaimParameters returns an object that can list and get ResourceClaimParameters in one namespace. +func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) resourcev1alpha2listers.ResourceClaimParametersNamespaceLister { + return &resourceClaimParametersNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} +} + +// resourceClaimParametersNamespaceLister implements the resourcev1alpha2listers.ResourceClaimParametersNamespaceLister interface. +type resourceClaimParametersNamespaceLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string +} + +// List lists all ResourceClaimParameters in the indexer for a given workspace and namespace. +func (s *resourceClaimParametersNamespaceLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClaimParameters, err error) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { + ret = append(ret, i.(*resourcev1alpha2.ResourceClaimParameters)) + }) + return ret, err +} + +// Get retrieves the ResourceClaimParameters from the indexer for a given workspace, namespace and name. +func (s *resourceClaimParametersNamespaceLister) Get(name string) (*resourcev1alpha2.ResourceClaimParameters, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(resourcev1alpha2.Resource("resourceclaimparameters"), name) + } + return obj.(*resourcev1alpha2.ResourceClaimParameters), nil +} diff --git a/listers/resource/v1alpha2/resourceclaimparameters_expansion.go b/listers/resource/v1alpha2/resourceclaimparameters_expansion.go new file mode 100644 index 000000000..ac7886a6d --- /dev/null +++ b/listers/resource/v1alpha2/resourceclaimparameters_expansion.go @@ -0,0 +1,25 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +// ResourceClaimParametersClusterListerExpansion allows custom methods to be added to ResourceClaimParametersClusterLister. +type ResourceClaimParametersClusterListerExpansion interface{} diff --git a/listers/resource/v1alpha2/resourceclassparameters.go b/listers/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..7c46129ff --- /dev/null +++ b/listers/resource/v1alpha2/resourceclassparameters.go @@ -0,0 +1,118 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + "k8s.io/client-go/tools/cache" +) + +// ResourceClassParametersClusterLister can list ResourceClassParameters across all workspaces, or scope down to a ResourceClassParametersLister for one workspace. +// All objects returned here must be treated as read-only. +type ResourceClassParametersClusterLister interface { + // List lists all ResourceClassParameters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClassParameters, err error) + // Cluster returns a lister that can list and get ResourceClassParameters in one workspace. + Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceClassParametersLister + ResourceClassParametersClusterListerExpansion +} + +type resourceClassParametersClusterLister struct { + indexer cache.Indexer +} + +// NewResourceClassParametersClusterLister returns a new ResourceClassParametersClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +// - has the kcpcache.ClusterAndNamespaceIndex as an index +func NewResourceClassParametersClusterLister(indexer cache.Indexer) *resourceClassParametersClusterLister { + return &resourceClassParametersClusterLister{indexer: indexer} +} + +// List lists all ResourceClassParameters in the indexer across all workspaces. +func (s *resourceClassParametersClusterLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClassParameters, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*resourcev1alpha2.ResourceClassParameters)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get ResourceClassParameters. +func (s *resourceClassParametersClusterLister) Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceClassParametersLister { + return &resourceClassParametersLister{indexer: s.indexer, clusterName: clusterName} +} + +// resourceClassParametersLister implements the resourcev1alpha2listers.ResourceClassParametersLister interface. +type resourceClassParametersLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all ResourceClassParameters in the indexer for a workspace. +func (s *resourceClassParametersLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClassParameters, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*resourcev1alpha2.ResourceClassParameters)) + }) + return ret, err +} + +// ResourceClassParameters returns an object that can list and get ResourceClassParameters in one namespace. +func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) resourcev1alpha2listers.ResourceClassParametersNamespaceLister { + return &resourceClassParametersNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} +} + +// resourceClassParametersNamespaceLister implements the resourcev1alpha2listers.ResourceClassParametersNamespaceLister interface. +type resourceClassParametersNamespaceLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string +} + +// List lists all ResourceClassParameters in the indexer for a given workspace and namespace. +func (s *resourceClassParametersNamespaceLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceClassParameters, err error) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { + ret = append(ret, i.(*resourcev1alpha2.ResourceClassParameters)) + }) + return ret, err +} + +// Get retrieves the ResourceClassParameters from the indexer for a given workspace, namespace and name. +func (s *resourceClassParametersNamespaceLister) Get(name string) (*resourcev1alpha2.ResourceClassParameters, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(resourcev1alpha2.Resource("resourceclassparameters"), name) + } + return obj.(*resourcev1alpha2.ResourceClassParameters), nil +} diff --git a/listers/resource/v1alpha2/resourceclassparameters_expansion.go b/listers/resource/v1alpha2/resourceclassparameters_expansion.go new file mode 100644 index 000000000..d98eb7e12 --- /dev/null +++ b/listers/resource/v1alpha2/resourceclassparameters_expansion.go @@ -0,0 +1,25 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +// ResourceClassParametersClusterListerExpansion allows custom methods to be added to ResourceClassParametersClusterLister. +type ResourceClassParametersClusterListerExpansion interface{} diff --git a/listers/resource/v1alpha2/resourceslice.go b/listers/resource/v1alpha2/resourceslice.go new file mode 100644 index 000000000..36f450e29 --- /dev/null +++ b/listers/resource/v1alpha2/resourceslice.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha2 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + "k8s.io/client-go/tools/cache" +) + +// ResourceSliceClusterLister can list ResourceSlices across all workspaces, or scope down to a ResourceSliceLister for one workspace. +// All objects returned here must be treated as read-only. +type ResourceSliceClusterLister interface { + // List lists all ResourceSlices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceSlice, err error) + // Cluster returns a lister that can list and get ResourceSlices in one workspace. + Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceSliceLister + ResourceSliceClusterListerExpansion +} + +type resourceSliceClusterLister struct { + indexer cache.Indexer +} + +// NewResourceSliceClusterLister returns a new ResourceSliceClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +func NewResourceSliceClusterLister(indexer cache.Indexer) *resourceSliceClusterLister { + return &resourceSliceClusterLister{indexer: indexer} +} + +// List lists all ResourceSlices in the indexer across all workspaces. +func (s *resourceSliceClusterLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceSlice, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*resourcev1alpha2.ResourceSlice)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get ResourceSlices. +func (s *resourceSliceClusterLister) Cluster(clusterName logicalcluster.Name) resourcev1alpha2listers.ResourceSliceLister { + return &resourceSliceLister{indexer: s.indexer, clusterName: clusterName} +} + +// resourceSliceLister implements the resourcev1alpha2listers.ResourceSliceLister interface. +type resourceSliceLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all ResourceSlices in the indexer for a workspace. +func (s *resourceSliceLister) List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceSlice, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*resourcev1alpha2.ResourceSlice)) + }) + return ret, err +} + +// Get retrieves the ResourceSlice from the indexer for a given workspace and name. +func (s *resourceSliceLister) Get(name string) (*resourcev1alpha2.ResourceSlice, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(resourcev1alpha2.Resource("resourceslices"), name) + } + return obj.(*resourcev1alpha2.ResourceSlice), nil +} diff --git a/listers/extensions/v1beta1/podsecuritypolicy_expansion.go b/listers/resource/v1alpha2/resourceslice_expansion.go similarity index 78% rename from listers/extensions/v1beta1/podsecuritypolicy_expansion.go rename to listers/resource/v1alpha2/resourceslice_expansion.go index 775adac81..c577f30e6 100644 --- a/listers/extensions/v1beta1/podsecuritypolicy_expansion.go +++ b/listers/resource/v1alpha2/resourceslice_expansion.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1beta1 +package v1alpha2 -// PodSecurityPolicyClusterListerExpansion allows custom methods to be added to PodSecurityPolicyClusterLister. -type PodSecurityPolicyClusterListerExpansion interface{} +// ResourceSliceClusterListerExpansion allows custom methods to be added to ResourceSliceClusterLister. +type ResourceSliceClusterListerExpansion interface{} diff --git a/listers/storage/v1alpha1/volumeattributesclass.go b/listers/storage/v1alpha1/volumeattributesclass.go new file mode 100644 index 000000000..847814db2 --- /dev/null +++ b/listers/storage/v1alpha1/volumeattributesclass.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + storagev1alpha1 "k8s.io/api/storage/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + storagev1alpha1listers "k8s.io/client-go/listers/storage/v1alpha1" + "k8s.io/client-go/tools/cache" +) + +// VolumeAttributesClassClusterLister can list VolumeAttributesClasses across all workspaces, or scope down to a VolumeAttributesClassLister for one workspace. +// All objects returned here must be treated as read-only. +type VolumeAttributesClassClusterLister interface { + // List lists all VolumeAttributesClasses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*storagev1alpha1.VolumeAttributesClass, err error) + // Cluster returns a lister that can list and get VolumeAttributesClasses in one workspace. + Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.VolumeAttributesClassLister + VolumeAttributesClassClusterListerExpansion +} + +type volumeAttributesClassClusterLister struct { + indexer cache.Indexer +} + +// NewVolumeAttributesClassClusterLister returns a new VolumeAttributesClassClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +func NewVolumeAttributesClassClusterLister(indexer cache.Indexer) *volumeAttributesClassClusterLister { + return &volumeAttributesClassClusterLister{indexer: indexer} +} + +// List lists all VolumeAttributesClasses in the indexer across all workspaces. +func (s *volumeAttributesClassClusterLister) List(selector labels.Selector) (ret []*storagev1alpha1.VolumeAttributesClass, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*storagev1alpha1.VolumeAttributesClass)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get VolumeAttributesClasses. +func (s *volumeAttributesClassClusterLister) Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.VolumeAttributesClassLister { + return &volumeAttributesClassLister{indexer: s.indexer, clusterName: clusterName} +} + +// volumeAttributesClassLister implements the storagev1alpha1listers.VolumeAttributesClassLister interface. +type volumeAttributesClassLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all VolumeAttributesClasses in the indexer for a workspace. +func (s *volumeAttributesClassLister) List(selector labels.Selector) (ret []*storagev1alpha1.VolumeAttributesClass, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*storagev1alpha1.VolumeAttributesClass)) + }) + return ret, err +} + +// Get retrieves the VolumeAttributesClass from the indexer for a given workspace and name. +func (s *volumeAttributesClassLister) Get(name string) (*storagev1alpha1.VolumeAttributesClass, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(storagev1alpha1.Resource("volumeattributesclasses"), name) + } + return obj.(*storagev1alpha1.VolumeAttributesClass), nil +} diff --git a/listers/policy/v1beta1/podsecuritypolicy_expansion.go b/listers/storage/v1alpha1/volumeattributesclass_expansion.go similarity index 77% rename from listers/policy/v1beta1/podsecuritypolicy_expansion.go rename to listers/storage/v1alpha1/volumeattributesclass_expansion.go index 775adac81..5d3e3113b 100644 --- a/listers/policy/v1beta1/podsecuritypolicy_expansion.go +++ b/listers/storage/v1alpha1/volumeattributesclass_expansion.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by kcp code-generator. DO NOT EDIT. -package v1beta1 +package v1alpha1 -// PodSecurityPolicyClusterListerExpansion allows custom methods to be added to PodSecurityPolicyClusterLister. -type PodSecurityPolicyClusterListerExpansion interface{} +// VolumeAttributesClassClusterListerExpansion allows custom methods to be added to VolumeAttributesClassClusterLister. +type VolumeAttributesClassClusterListerExpansion interface{} diff --git a/listers/storagemigration/v1alpha1/storageversionmigration.go b/listers/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..eab929412 --- /dev/null +++ b/listers/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +import ( + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" + + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + storagemigrationv1alpha1listers "k8s.io/client-go/listers/storagemigration/v1alpha1" + "k8s.io/client-go/tools/cache" +) + +// StorageVersionMigrationClusterLister can list StorageVersionMigrations across all workspaces, or scope down to a StorageVersionMigrationLister for one workspace. +// All objects returned here must be treated as read-only. +type StorageVersionMigrationClusterLister interface { + // List lists all StorageVersionMigrations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*storagemigrationv1alpha1.StorageVersionMigration, err error) + // Cluster returns a lister that can list and get StorageVersionMigrations in one workspace. + Cluster(clusterName logicalcluster.Name) storagemigrationv1alpha1listers.StorageVersionMigrationLister + StorageVersionMigrationClusterListerExpansion +} + +type storageVersionMigrationClusterLister struct { + indexer cache.Indexer +} + +// NewStorageVersionMigrationClusterLister returns a new StorageVersionMigrationClusterLister. +// We assume that the indexer: +// - is fed by a cross-workspace LIST+WATCH +// - uses kcpcache.MetaClusterNamespaceKeyFunc as the key function +// - has the kcpcache.ClusterIndex as an index +func NewStorageVersionMigrationClusterLister(indexer cache.Indexer) *storageVersionMigrationClusterLister { + return &storageVersionMigrationClusterLister{indexer: indexer} +} + +// List lists all StorageVersionMigrations in the indexer across all workspaces. +func (s *storageVersionMigrationClusterLister) List(selector labels.Selector) (ret []*storagemigrationv1alpha1.StorageVersionMigration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*storagemigrationv1alpha1.StorageVersionMigration)) + }) + return ret, err +} + +// Cluster scopes the lister to one workspace, allowing users to list and get StorageVersionMigrations. +func (s *storageVersionMigrationClusterLister) Cluster(clusterName logicalcluster.Name) storagemigrationv1alpha1listers.StorageVersionMigrationLister { + return &storageVersionMigrationLister{indexer: s.indexer, clusterName: clusterName} +} + +// storageVersionMigrationLister implements the storagemigrationv1alpha1listers.StorageVersionMigrationLister interface. +type storageVersionMigrationLister struct { + indexer cache.Indexer + clusterName logicalcluster.Name +} + +// List lists all StorageVersionMigrations in the indexer for a workspace. +func (s *storageVersionMigrationLister) List(selector labels.Selector) (ret []*storagemigrationv1alpha1.StorageVersionMigration, err error) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { + ret = append(ret, i.(*storagemigrationv1alpha1.StorageVersionMigration)) + }) + return ret, err +} + +// Get retrieves the StorageVersionMigration from the indexer for a given workspace and name. +func (s *storageVersionMigrationLister) Get(name string) (*storagemigrationv1alpha1.StorageVersionMigration, error) { + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) + obj, exists, err := s.indexer.GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(storagemigrationv1alpha1.Resource("storageversionmigrations"), name) + } + return obj.(*storagemigrationv1alpha1.StorageVersionMigration), nil +} diff --git a/listers/storagemigration/v1alpha1/storageversionmigration_expansion.go b/listers/storagemigration/v1alpha1/storageversionmigration_expansion.go new file mode 100644 index 000000000..dbd4b6c1b --- /dev/null +++ b/listers/storagemigration/v1alpha1/storageversionmigration_expansion.go @@ -0,0 +1,25 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The KCP 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 kcp code-generator. DO NOT EDIT. + +package v1alpha1 + +// StorageVersionMigrationClusterListerExpansion allows custom methods to be added to StorageVersionMigrationClusterLister. +type StorageVersionMigrationClusterListerExpansion interface{}