generated

Kubernetes-commit: a7505f026215954809d57b9e6c0a3abdddf00e16
This commit is contained in:
Jefftree 2025-03-12 16:59:43 +00:00 committed by Kubernetes Publisher
parent dbe73bc712
commit 0a56d352bc
14 changed files with 712 additions and 0 deletions

View File

@ -0,0 +1,255 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
internal "k8s.io/client-go/applyconfigurations/internal"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// LeaseCandidateApplyConfiguration represents a declarative configuration of the LeaseCandidate type for use
// with apply.
type LeaseCandidateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *LeaseCandidateSpecApplyConfiguration `json:"spec,omitempty"`
}
// LeaseCandidate constructs a declarative configuration of the LeaseCandidate type for use with
// apply.
func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration {
b := &LeaseCandidateApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("LeaseCandidate")
b.WithAPIVersion("coordination.k8s.io/v1beta1")
return b
}
// ExtractLeaseCandidate extracts the applied configuration owned by fieldManager from
// leaseCandidate. If no managedFields are found in leaseCandidate for fieldManager, a
// LeaseCandidateApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// leaseCandidate must be a unmodified LeaseCandidate API object that was retrieved from the Kubernetes API.
// ExtractLeaseCandidate provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractLeaseCandidate(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
return extractLeaseCandidate(leaseCandidate, fieldManager, "")
}
// ExtractLeaseCandidateStatus is the same as ExtractLeaseCandidate except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
return extractLeaseCandidate(leaseCandidate, fieldManager, "status")
}
func extractLeaseCandidate(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) {
b := &LeaseCandidateApplyConfiguration{}
err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1beta1.LeaseCandidate"), fieldManager, b, subresource)
if err != nil {
return nil, err
}
b.WithName(leaseCandidate.Name)
b.WithNamespace(leaseCandidate.Namespace)
b.WithKind("LeaseCandidate")
b.WithAPIVersion("coordination.k8s.io/v1beta1")
return b, nil
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithKind(value string) *LeaseCandidateApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithAPIVersion(value string) *LeaseCandidateApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithName(value string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithGenerateName(value string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithNamespace(value string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithUID(value types.UID) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithResourceVersion(value string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithGeneration(value int64) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *LeaseCandidateApplyConfiguration) WithLabels(entries map[string]string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *LeaseCandidateApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *LeaseCandidateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *LeaseCandidateApplyConfiguration) WithFinalizers(values ...string) *LeaseCandidateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *LeaseCandidateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *LeaseCandidateApplyConfiguration) WithSpec(value *LeaseCandidateSpecApplyConfiguration) *LeaseCandidateApplyConfiguration {
b.Spec = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *LeaseCandidateApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,89 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
coordinationv1 "k8s.io/api/coordination/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use
// with apply.
type LeaseCandidateSpecApplyConfiguration struct {
LeaseName *string `json:"leaseName,omitempty"`
PingTime *v1.MicroTime `json:"pingTime,omitempty"`
RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
BinaryVersion *string `json:"binaryVersion,omitempty"`
EmulationVersion *string `json:"emulationVersion,omitempty"`
Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"`
}
// LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with
// apply.
func LeaseCandidateSpec() *LeaseCandidateSpecApplyConfiguration {
return &LeaseCandidateSpecApplyConfiguration{}
}
// WithLeaseName sets the LeaseName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LeaseName field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithLeaseName(value string) *LeaseCandidateSpecApplyConfiguration {
b.LeaseName = &value
return b
}
// WithPingTime sets the PingTime field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PingTime field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithPingTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration {
b.PingTime = &value
return b
}
// WithRenewTime sets the RenewTime field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RenewTime field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration {
b.RenewTime = &value
return b
}
// WithBinaryVersion sets the BinaryVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the BinaryVersion field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithBinaryVersion(value string) *LeaseCandidateSpecApplyConfiguration {
b.BinaryVersion = &value
return b
}
// WithEmulationVersion sets the EmulationVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the EmulationVersion field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string) *LeaseCandidateSpecApplyConfiguration {
b.EmulationVersion = &value
return b
}
// WithStrategy sets the Strategy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Strategy field is set to the value of the last call.
func (b *LeaseCandidateSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration {
b.Strategy = &value
return b
}

View File

@ -4570,6 +4570,46 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.coordination.v1beta1.LeaseSpec
default: {}
- name: io.k8s.api.coordination.v1beta1.LeaseCandidate
map:
fields:
- name: apiVersion
type:
scalar: string
- name: kind
type:
scalar: string
- name: metadata
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
default: {}
- name: spec
type:
namedType: io.k8s.api.coordination.v1beta1.LeaseCandidateSpec
default: {}
- name: io.k8s.api.coordination.v1beta1.LeaseCandidateSpec
map:
fields:
- name: binaryVersion
type:
scalar: string
default: ""
- name: emulationVersion
type:
scalar: string
- name: leaseName
type:
scalar: string
default: ""
- name: pingTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime
- name: renewTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime
- name: strategy
type:
scalar: string
- name: io.k8s.api.coordination.v1beta1.LeaseSpec
map:
fields:

View File

@ -644,6 +644,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
// Group=coordination.k8s.io, Version=v1beta1
case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"):
return &applyconfigurationscoordinationv1beta1.LeaseApplyConfiguration{}
case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseCandidate"):
return &applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration{}
case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"):
return &applyconfigurationscoordinationv1beta1.LeaseCandidateSpecApplyConfiguration{}
case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseSpec"):
return &applyconfigurationscoordinationv1beta1.LeaseSpecApplyConfiguration{}

View File

@ -26,6 +26,8 @@ import (
type Interface interface {
// Leases returns a LeaseInformer.
Leases() LeaseInformer
// LeaseCandidates returns a LeaseCandidateInformer.
LeaseCandidates() LeaseCandidateInformer
}
type version struct {
@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
func (v *version) Leases() LeaseInformer {
return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// LeaseCandidates returns a LeaseCandidateInformer.
func (v *version) LeaseCandidates() LeaseCandidateInformer {
return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,102 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1beta1
import (
context "context"
time "time"
apicoordinationv1beta1 "k8s.io/api/coordination/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
coordinationv1beta1 "k8s.io/client-go/listers/coordination/v1beta1"
cache "k8s.io/client-go/tools/cache"
)
// LeaseCandidateInformer provides access to a shared informer and lister for
// LeaseCandidates.
type LeaseCandidateInformer interface {
Informer() cache.SharedIndexInformer
Lister() coordinationv1beta1.LeaseCandidateLister
}
type leaseCandidateInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewLeaseCandidateInformer constructs a new informer for LeaseCandidate 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 NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredLeaseCandidateInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate 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 NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().LeaseCandidates(namespace).List(context.Background(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().LeaseCandidates(namespace).Watch(context.Background(), options)
},
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().LeaseCandidates(namespace).List(ctx, options)
},
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().LeaseCandidates(namespace).Watch(ctx, options)
},
},
&apicoordinationv1beta1.LeaseCandidate{},
resyncPeriod,
indexers,
)
}
func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredLeaseCandidateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&apicoordinationv1beta1.LeaseCandidate{}, f.defaultInformer)
}
func (f *leaseCandidateInformer) Lister() coordinationv1beta1.LeaseCandidateLister {
return coordinationv1beta1.NewLeaseCandidateLister(f.Informer().GetIndexer())
}

View File

@ -213,6 +213,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=coordination.k8s.io, Version=v1beta1
case coordinationv1beta1.SchemeGroupVersion.WithResource("leases"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().Leases().Informer()}, nil
case coordinationv1beta1.SchemeGroupVersion.WithResource("leasecandidates"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().LeaseCandidates().Informer()}, nil
// Group=core, Version=v1
case corev1.SchemeGroupVersion.WithResource("componentstatuses"):

View File

@ -29,6 +29,7 @@ import (
type CoordinationV1beta1Interface interface {
RESTClient() rest.Interface
LeasesGetter
LeaseCandidatesGetter
}
// CoordinationV1beta1Client is used to interact with features provided by the coordination.k8s.io group.
@ -40,6 +41,10 @@ func (c *CoordinationV1beta1Client) Leases(namespace string) LeaseInterface {
return newLeases(c, namespace)
}
func (c *CoordinationV1beta1Client) LeaseCandidates(namespace string) LeaseCandidateInterface {
return newLeaseCandidates(c, namespace)
}
// NewForConfig creates a new CoordinationV1beta1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).

View File

@ -32,6 +32,10 @@ func (c *FakeCoordinationV1beta1) Leases(namespace string) v1beta1.LeaseInterfac
return newFakeLeases(c, namespace)
}
func (c *FakeCoordinationV1beta1) LeaseCandidates(namespace string) v1beta1.LeaseCandidateInterface {
return newFakeLeaseCandidates(c, namespace)
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCoordinationV1beta1) RESTClient() rest.Interface {

View File

@ -0,0 +1,53 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1beta1 "k8s.io/api/coordination/v1beta1"
coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
gentype "k8s.io/client-go/gentype"
typedcoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1"
)
// fakeLeaseCandidates implements LeaseCandidateInterface
type fakeLeaseCandidates struct {
*gentype.FakeClientWithListAndApply[*v1beta1.LeaseCandidate, *v1beta1.LeaseCandidateList, *coordinationv1beta1.LeaseCandidateApplyConfiguration]
Fake *FakeCoordinationV1beta1
}
func newFakeLeaseCandidates(fake *FakeCoordinationV1beta1, namespace string) typedcoordinationv1beta1.LeaseCandidateInterface {
return &fakeLeaseCandidates{
gentype.NewFakeClientWithListAndApply[*v1beta1.LeaseCandidate, *v1beta1.LeaseCandidateList, *coordinationv1beta1.LeaseCandidateApplyConfiguration](
fake.Fake,
namespace,
v1beta1.SchemeGroupVersion.WithResource("leasecandidates"),
v1beta1.SchemeGroupVersion.WithKind("LeaseCandidate"),
func() *v1beta1.LeaseCandidate { return &v1beta1.LeaseCandidate{} },
func() *v1beta1.LeaseCandidateList { return &v1beta1.LeaseCandidateList{} },
func(dst, src *v1beta1.LeaseCandidateList) { dst.ListMeta = src.ListMeta },
func(list *v1beta1.LeaseCandidateList) []*v1beta1.LeaseCandidate {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1beta1.LeaseCandidateList, items []*v1beta1.LeaseCandidate) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
}

View File

@ -19,3 +19,5 @@ limitations under the License.
package v1beta1
type LeaseExpansion interface{}
type LeaseCandidateExpansion interface{}

View File

@ -0,0 +1,71 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
context "context"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
gentype "k8s.io/client-go/gentype"
scheme "k8s.io/client-go/kubernetes/scheme"
)
// LeaseCandidatesGetter has a method to return a LeaseCandidateInterface.
// A group's client should implement this interface.
type LeaseCandidatesGetter interface {
LeaseCandidates(namespace string) LeaseCandidateInterface
}
// LeaseCandidateInterface has methods to work with LeaseCandidate resources.
type LeaseCandidateInterface interface {
Create(ctx context.Context, leaseCandidate *coordinationv1beta1.LeaseCandidate, opts v1.CreateOptions) (*coordinationv1beta1.LeaseCandidate, error)
Update(ctx context.Context, leaseCandidate *coordinationv1beta1.LeaseCandidate, opts v1.UpdateOptions) (*coordinationv1beta1.LeaseCandidate, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*coordinationv1beta1.LeaseCandidate, error)
List(ctx context.Context, opts v1.ListOptions) (*coordinationv1beta1.LeaseCandidateList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *coordinationv1beta1.LeaseCandidate, err error)
Apply(ctx context.Context, leaseCandidate *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *coordinationv1beta1.LeaseCandidate, err error)
LeaseCandidateExpansion
}
// leaseCandidates implements LeaseCandidateInterface
type leaseCandidates struct {
*gentype.ClientWithListAndApply[*coordinationv1beta1.LeaseCandidate, *coordinationv1beta1.LeaseCandidateList, *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration]
}
// newLeaseCandidates returns a LeaseCandidates
func newLeaseCandidates(c *CoordinationV1beta1Client, namespace string) *leaseCandidates {
return &leaseCandidates{
gentype.NewClientWithListAndApply[*coordinationv1beta1.LeaseCandidate, *coordinationv1beta1.LeaseCandidateList, *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration](
"leasecandidates",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *coordinationv1beta1.LeaseCandidate { return &coordinationv1beta1.LeaseCandidate{} },
func() *coordinationv1beta1.LeaseCandidateList { return &coordinationv1beta1.LeaseCandidateList{} },
gentype.PrefersProtobuf[*coordinationv1beta1.LeaseCandidate](),
),
}
}

View File

@ -25,3 +25,11 @@ type LeaseListerExpansion interface{}
// LeaseNamespaceListerExpansion allows custom methods to be added to
// LeaseNamespaceLister.
type LeaseNamespaceListerExpansion interface{}
// LeaseCandidateListerExpansion allows custom methods to be added to
// LeaseCandidateLister.
type LeaseCandidateListerExpansion interface{}
// LeaseCandidateNamespaceListerExpansion allows custom methods to be added to
// LeaseCandidateNamespaceLister.
type LeaseCandidateNamespaceListerExpansion interface{}

View File

@ -0,0 +1,70 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1beta1
import (
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
)
// LeaseCandidateLister helps list LeaseCandidates.
// All objects returned here must be treated as read-only.
type LeaseCandidateLister interface {
// List lists all LeaseCandidates in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*coordinationv1beta1.LeaseCandidate, err error)
// LeaseCandidates returns an object that can list and get LeaseCandidates.
LeaseCandidates(namespace string) LeaseCandidateNamespaceLister
LeaseCandidateListerExpansion
}
// leaseCandidateLister implements the LeaseCandidateLister interface.
type leaseCandidateLister struct {
listers.ResourceIndexer[*coordinationv1beta1.LeaseCandidate]
}
// NewLeaseCandidateLister returns a new LeaseCandidateLister.
func NewLeaseCandidateLister(indexer cache.Indexer) LeaseCandidateLister {
return &leaseCandidateLister{listers.New[*coordinationv1beta1.LeaseCandidate](indexer, coordinationv1beta1.Resource("leasecandidate"))}
}
// LeaseCandidates returns an object that can list and get LeaseCandidates.
func (s *leaseCandidateLister) LeaseCandidates(namespace string) LeaseCandidateNamespaceLister {
return leaseCandidateNamespaceLister{listers.NewNamespaced[*coordinationv1beta1.LeaseCandidate](s.ResourceIndexer, namespace)}
}
// LeaseCandidateNamespaceLister helps list and get LeaseCandidates.
// All objects returned here must be treated as read-only.
type LeaseCandidateNamespaceLister interface {
// List lists all LeaseCandidates in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*coordinationv1beta1.LeaseCandidate, err error)
// Get retrieves the LeaseCandidate from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*coordinationv1beta1.LeaseCandidate, error)
LeaseCandidateNamespaceListerExpansion
}
// leaseCandidateNamespaceLister implements the LeaseCandidateNamespaceLister
// interface.
type leaseCandidateNamespaceLister struct {
listers.ResourceIndexer[*coordinationv1beta1.LeaseCandidate]
}