Graduate EndpointSlice API to GA

* Removes discovery v1alpha1 API
  * Replaces per Endpoint Topology with a read only DeprecatedTopology
  in GA API
  * Adds per Endpoint Zone field in GA API

Kubernetes-commit: a9891b4b9b909b76533a50812c21575cd96c43b1
This commit is contained in:
Swetha Repakula 2021-03-03 06:47:10 +00:00 committed by Kubernetes Publisher
parent d2a6442e7d
commit 2eb8aff5d3
22 changed files with 212 additions and 203 deletions

View File

@ -16,21 +16,22 @@ limitations under the License.
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1 "k8s.io/client-go/applyconfigurations/core/v1"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// EndpointApplyConfiguration represents an declarative configuration of the Endpoint type for use
// with apply.
type EndpointApplyConfiguration struct {
Addresses []string `json:"addresses,omitempty"`
Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"`
Hostname *string `json:"hostname,omitempty"`
TargetRef *v1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"`
Topology map[string]string `json:"topology,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
Addresses []string `json:"addresses,omitempty"`
Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"`
Hostname *string `json:"hostname,omitempty"`
TargetRef *corev1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"`
DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
Zone *string `json:"zone,omitempty"`
}
// EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with
@ -68,21 +69,21 @@ func (b *EndpointApplyConfiguration) WithHostname(value string) *EndpointApplyCo
// WithTargetRef sets the TargetRef 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 TargetRef field is set to the value of the last call.
func (b *EndpointApplyConfiguration) WithTargetRef(value *v1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration {
func (b *EndpointApplyConfiguration) WithTargetRef(value *corev1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration {
b.TargetRef = value
return b
}
// WithTopology puts the entries into the Topology field in the declarative configuration
// WithDeprecatedTopology puts the entries into the DeprecatedTopology 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 Topology field,
// overwriting an existing map entries in Topology field with the same key.
func (b *EndpointApplyConfiguration) WithTopology(entries map[string]string) *EndpointApplyConfiguration {
if b.Topology == nil && len(entries) > 0 {
b.Topology = make(map[string]string, len(entries))
// If called multiple times, the entries provided by each call will be put on the DeprecatedTopology field,
// overwriting an existing map entries in DeprecatedTopology field with the same key.
func (b *EndpointApplyConfiguration) WithDeprecatedTopology(entries map[string]string) *EndpointApplyConfiguration {
if b.DeprecatedTopology == nil && len(entries) > 0 {
b.DeprecatedTopology = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Topology[k] = v
b.DeprecatedTopology[k] = v
}
return b
}
@ -94,3 +95,11 @@ func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyCo
b.NodeName = &value
return b
}
// WithZone sets the Zone 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 Zone field is set to the value of the last call.
func (b *EndpointApplyConfiguration) WithZone(value string) *EndpointApplyConfiguration {
b.Zone = &value
return b
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
package v1
// EndpointConditionsApplyConfiguration represents an declarative configuration of the EndpointConditions type for use
// with apply.

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1 "k8s.io/api/core/v1"

View File

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
@ -30,7 +30,7 @@ import (
type EndpointSliceApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
AddressType *v1alpha1.AddressType `json:"addressType,omitempty"`
AddressType *discoveryv1.AddressType `json:"addressType,omitempty"`
Endpoints []EndpointApplyConfiguration `json:"endpoints,omitempty"`
Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"`
}
@ -42,7 +42,7 @@ func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration {
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("EndpointSlice")
b.WithAPIVersion("discovery.k8s.io/v1alpha1")
b.WithAPIVersion("discovery.k8s.io/v1")
return b
}
@ -225,7 +225,7 @@ func (b *EndpointSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExis
// WithAddressType sets the AddressType 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 AddressType field is set to the value of the last call.
func (b *EndpointSliceApplyConfiguration) WithAddressType(value v1alpha1.AddressType) *EndpointSliceApplyConfiguration {
func (b *EndpointSliceApplyConfiguration) WithAddressType(value discoveryv1.AddressType) *EndpointSliceApplyConfiguration {
b.AddressType = &value
return b
}

View File

@ -35,12 +35,12 @@ import (
coordinationv1 "k8s.io/api/coordination/v1"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
corev1 "k8s.io/api/core/v1"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1"
networkingv1 "k8s.io/api/networking/v1"
@ -76,12 +76,12 @@ import (
applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1"
applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
discoveryv1alpha1 "k8s.io/client-go/applyconfigurations/discovery/v1alpha1"
applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1"
applyconfigurationsdiscoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1"
applyconfigurationseventsv1 "k8s.io/client-go/applyconfigurations/events/v1"
applyconfigurationseventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1"
applyconfigurationsextensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
applyconfigurationsflowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1"
flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1"
applyconfigurationsflowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1"
applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1"
applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1"
@ -772,15 +772,15 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"):
return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{}
// Group=discovery.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithKind("Endpoint"):
return &discoveryv1alpha1.EndpointApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("EndpointConditions"):
return &discoveryv1alpha1.EndpointConditionsApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("EndpointPort"):
return &discoveryv1alpha1.EndpointPortApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("EndpointSlice"):
return &discoveryv1alpha1.EndpointSliceApplyConfiguration{}
// Group=discovery.k8s.io, Version=v1
case discoveryv1.SchemeGroupVersion.WithKind("Endpoint"):
return &applyconfigurationsdiscoveryv1.EndpointApplyConfiguration{}
case discoveryv1.SchemeGroupVersion.WithKind("EndpointConditions"):
return &applyconfigurationsdiscoveryv1.EndpointConditionsApplyConfiguration{}
case discoveryv1.SchemeGroupVersion.WithKind("EndpointPort"):
return &applyconfigurationsdiscoveryv1.EndpointPortApplyConfiguration{}
case discoveryv1.SchemeGroupVersion.WithKind("EndpointSlice"):
return &applyconfigurationsdiscoveryv1.EndpointSliceApplyConfiguration{}
// Group=discovery.k8s.io, Version=v1beta1
case discoveryv1beta1.SchemeGroupVersion.WithKind("Endpoint"):
@ -899,46 +899,46 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsextensionsv1beta1.SupplementalGroupsStrategyOptionsApplyConfiguration{}
// Group=flowcontrol.apiserver.k8s.io, Version=v1alpha1
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"):
return &applyconfigurationsflowcontrolv1alpha1.FlowDistinguisherMethodApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("FlowSchema"):
return &applyconfigurationsflowcontrolv1alpha1.FlowSchemaApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("FlowSchemaCondition"):
return &applyconfigurationsflowcontrolv1alpha1.FlowSchemaConditionApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("FlowSchemaSpec"):
return &applyconfigurationsflowcontrolv1alpha1.FlowSchemaSpecApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("FlowSchemaStatus"):
return &applyconfigurationsflowcontrolv1alpha1.FlowSchemaStatusApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("GroupSubject"):
return &applyconfigurationsflowcontrolv1alpha1.GroupSubjectApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"):
return &applyconfigurationsflowcontrolv1alpha1.LimitedPriorityLevelConfigurationApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("LimitResponse"):
return &applyconfigurationsflowcontrolv1alpha1.LimitResponseApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"):
return &applyconfigurationsflowcontrolv1alpha1.NonResourcePolicyRuleApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"):
return &applyconfigurationsflowcontrolv1alpha1.PolicyRulesWithSubjectsApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"):
return &applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"):
return &applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationConditionApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"):
return &applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationReferenceApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"):
return &applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationSpecApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"):
return &applyconfigurationsflowcontrolv1alpha1.PriorityLevelConfigurationStatusApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("QueuingConfiguration"):
return &applyconfigurationsflowcontrolv1alpha1.QueuingConfigurationApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("ResourcePolicyRule"):
return &applyconfigurationsflowcontrolv1alpha1.ResourcePolicyRuleApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("ServiceAccountSubject"):
return &applyconfigurationsflowcontrolv1alpha1.ServiceAccountSubjectApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("Subject"):
return &applyconfigurationsflowcontrolv1alpha1.SubjectApplyConfiguration{}
case flowcontrolv1alpha1.SchemeGroupVersion.WithKind("UserSubject"):
return &applyconfigurationsflowcontrolv1alpha1.UserSubjectApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"):
return &flowcontrolv1alpha1.FlowDistinguisherMethodApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("FlowSchema"):
return &flowcontrolv1alpha1.FlowSchemaApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("FlowSchemaCondition"):
return &flowcontrolv1alpha1.FlowSchemaConditionApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("FlowSchemaSpec"):
return &flowcontrolv1alpha1.FlowSchemaSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("FlowSchemaStatus"):
return &flowcontrolv1alpha1.FlowSchemaStatusApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("GroupSubject"):
return &flowcontrolv1alpha1.GroupSubjectApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"):
return &flowcontrolv1alpha1.LimitedPriorityLevelConfigurationApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("LimitResponse"):
return &flowcontrolv1alpha1.LimitResponseApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"):
return &flowcontrolv1alpha1.NonResourcePolicyRuleApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"):
return &flowcontrolv1alpha1.PolicyRulesWithSubjectsApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"):
return &flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"):
return &flowcontrolv1alpha1.PriorityLevelConfigurationConditionApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"):
return &flowcontrolv1alpha1.PriorityLevelConfigurationReferenceApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"):
return &flowcontrolv1alpha1.PriorityLevelConfigurationSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"):
return &flowcontrolv1alpha1.PriorityLevelConfigurationStatusApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("QueuingConfiguration"):
return &flowcontrolv1alpha1.QueuingConfigurationApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("ResourcePolicyRule"):
return &flowcontrolv1alpha1.ResourcePolicyRuleApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("ServiceAccountSubject"):
return &flowcontrolv1alpha1.ServiceAccountSubjectApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("Subject"):
return &flowcontrolv1alpha1.SubjectApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("UserSubject"):
return &flowcontrolv1alpha1.UserSubjectApplyConfiguration{}
// Group=flowcontrol.apiserver.k8s.io, Version=v1beta1
case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"):

View File

@ -19,15 +19,15 @@ limitations under the License.
package discovery
import (
v1alpha1 "k8s.io/client-go/informers/discovery/v1alpha1"
v1 "k8s.io/client-go/informers/discovery/v1"
v1beta1 "k8s.io/client-go/informers/discovery/v1beta1"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
}
@ -43,9 +43,9 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
// V1 returns a new v1.Interface.
func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}
// V1beta1 returns a new v1beta1.Interface.

View File

@ -16,19 +16,19 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"context"
time "time"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
discoveryv1 "k8s.io/api/discovery/v1"
metav1 "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"
v1alpha1 "k8s.io/client-go/listers/discovery/v1alpha1"
v1 "k8s.io/client-go/listers/discovery/v1"
cache "k8s.io/client-go/tools/cache"
)
@ -36,7 +36,7 @@ import (
// EndpointSlices.
type EndpointSliceInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.EndpointSliceLister
Lister() v1.EndpointSliceLister
}
type endpointSliceInformer struct {
@ -58,20 +58,20 @@ func NewEndpointSliceInformer(client kubernetes.Interface, namespace string, res
func NewFilteredEndpointSliceInformer(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) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1alpha1().EndpointSlices(namespace).List(context.TODO(), options)
return client.DiscoveryV1().EndpointSlices(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1alpha1().EndpointSlices(namespace).Watch(context.TODO(), options)
return client.DiscoveryV1().EndpointSlices(namespace).Watch(context.TODO(), options)
},
},
&discoveryv1alpha1.EndpointSlice{},
&discoveryv1.EndpointSlice{},
resyncPeriod,
indexers,
)
@ -82,9 +82,9 @@ func (f *endpointSliceInformer) defaultInformer(client kubernetes.Interface, res
}
func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&discoveryv1alpha1.EndpointSlice{}, f.defaultInformer)
return f.factory.InformerFor(&discoveryv1.EndpointSlice{}, f.defaultInformer)
}
func (f *endpointSliceInformer) Lister() v1alpha1.EndpointSliceLister {
return v1alpha1.NewEndpointSliceLister(f.Informer().GetIndexer())
func (f *endpointSliceInformer) Lister() v1.EndpointSliceLister {
return v1.NewEndpointSliceLister(f.Informer().GetIndexer())
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"

View File

@ -37,12 +37,12 @@ import (
coordinationv1 "k8s.io/api/coordination/v1"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
corev1 "k8s.io/api/core/v1"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
networkingv1 "k8s.io/api/networking/v1"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
@ -205,9 +205,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case corev1.SchemeGroupVersion.WithResource("serviceaccounts"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceAccounts().Informer()}, nil
// Group=discovery.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("endpointslices"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Discovery().V1alpha1().EndpointSlices().Informer()}, nil
// Group=discovery.k8s.io, Version=v1
case discoveryv1.SchemeGroupVersion.WithResource("endpointslices"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Discovery().V1().EndpointSlices().Informer()}, nil
// Group=discovery.k8s.io, Version=v1beta1
case discoveryv1beta1.SchemeGroupVersion.WithResource("endpointslices"):
@ -236,9 +236,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil
// Group=flowcontrol.apiserver.k8s.io, Version=v1alpha1
case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("flowschemas"):
case v1alpha1.SchemeGroupVersion.WithResource("flowschemas"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().FlowSchemas().Informer()}, nil
case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
case v1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().PriorityLevelConfigurations().Informer()}, nil
// Group=flowcontrol.apiserver.k8s.io, Version=v1beta1

View File

@ -42,7 +42,7 @@ import (
coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
discoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1"
eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1"
eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1"
@ -90,7 +90,7 @@ type Interface interface {
CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface
CoordinationV1() coordinationv1.CoordinationV1Interface
CoreV1() corev1.CoreV1Interface
DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface
DiscoveryV1() discoveryv1.DiscoveryV1Interface
DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface
EventsV1() eventsv1.EventsV1Interface
EventsV1beta1() eventsv1beta1.EventsV1beta1Interface
@ -138,7 +138,7 @@ type Clientset struct {
coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client
coordinationV1 *coordinationv1.CoordinationV1Client
coreV1 *corev1.CoreV1Client
discoveryV1alpha1 *discoveryv1alpha1.DiscoveryV1alpha1Client
discoveryV1 *discoveryv1.DiscoveryV1Client
discoveryV1beta1 *discoveryv1beta1.DiscoveryV1beta1Client
eventsV1 *eventsv1.EventsV1Client
eventsV1beta1 *eventsv1beta1.EventsV1beta1Client
@ -262,9 +262,9 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface {
return c.coreV1
}
// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client
func (c *Clientset) DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface {
return c.discoveryV1alpha1
// DiscoveryV1 retrieves the DiscoveryV1Client
func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface {
return c.discoveryV1
}
// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client
@ -473,7 +473,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.discoveryV1alpha1, err = discoveryv1alpha1.NewForConfig(&configShallowCopy)
cs.discoveryV1, err = discoveryv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
@ -593,7 +593,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.coordinationV1beta1 = coordinationv1beta1.NewForConfigOrDie(c)
cs.coordinationV1 = coordinationv1.NewForConfigOrDie(c)
cs.coreV1 = corev1.NewForConfigOrDie(c)
cs.discoveryV1alpha1 = discoveryv1alpha1.NewForConfigOrDie(c)
cs.discoveryV1 = discoveryv1.NewForConfigOrDie(c)
cs.discoveryV1beta1 = discoveryv1beta1.NewForConfigOrDie(c)
cs.eventsV1 = eventsv1.NewForConfigOrDie(c)
cs.eventsV1beta1 = eventsv1beta1.NewForConfigOrDie(c)
@ -643,7 +643,7 @@ func New(c rest.Interface) *Clientset {
cs.coordinationV1beta1 = coordinationv1beta1.New(c)
cs.coordinationV1 = coordinationv1.New(c)
cs.coreV1 = corev1.New(c)
cs.discoveryV1alpha1 = discoveryv1alpha1.New(c)
cs.discoveryV1 = discoveryv1.New(c)
cs.discoveryV1beta1 = discoveryv1beta1.New(c)
cs.eventsV1 = eventsv1.New(c)
cs.eventsV1beta1 = eventsv1beta1.New(c)

View File

@ -64,8 +64,8 @@ import (
fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake"
discoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
fakediscoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake"
discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
fakediscoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1/fake"
discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1"
fakediscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake"
eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1"
@ -258,9 +258,9 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface {
return &fakecorev1.FakeCoreV1{Fake: &c.Fake}
}
// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client
func (c *Clientset) DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface {
return &fakediscoveryv1alpha1.FakeDiscoveryV1alpha1{Fake: &c.Fake}
// DiscoveryV1 retrieves the DiscoveryV1Client
func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface {
return &fakediscoveryv1.FakeDiscoveryV1{Fake: &c.Fake}
}
// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client

View File

@ -39,7 +39,7 @@ import (
coordinationv1 "k8s.io/api/coordination/v1"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
corev1 "k8s.io/api/core/v1"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
@ -92,7 +92,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
coordinationv1beta1.AddToScheme,
coordinationv1.AddToScheme,
corev1.AddToScheme,
discoveryv1alpha1.AddToScheme,
discoveryv1.AddToScheme,
discoveryv1beta1.AddToScheme,
eventsv1.AddToScheme,
eventsv1beta1.AddToScheme,

View File

@ -39,7 +39,7 @@ import (
coordinationv1 "k8s.io/api/coordination/v1"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
corev1 "k8s.io/api/core/v1"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
@ -92,7 +92,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
coordinationv1beta1.AddToScheme,
coordinationv1.AddToScheme,
corev1.AddToScheme,
discoveryv1alpha1.AddToScheme,
discoveryv1.AddToScheme,
discoveryv1beta1.AddToScheme,
eventsv1.AddToScheme,
eventsv1beta1.AddToScheme,

View File

@ -16,30 +16,30 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/api/discovery/v1"
"k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
type DiscoveryV1alpha1Interface interface {
type DiscoveryV1Interface interface {
RESTClient() rest.Interface
EndpointSlicesGetter
}
// DiscoveryV1alpha1Client is used to interact with features provided by the discovery.k8s.io group.
type DiscoveryV1alpha1Client struct {
// DiscoveryV1Client is used to interact with features provided by the discovery.k8s.io group.
type DiscoveryV1Client struct {
restClient rest.Interface
}
func (c *DiscoveryV1alpha1Client) EndpointSlices(namespace string) EndpointSliceInterface {
func (c *DiscoveryV1Client) EndpointSlices(namespace string) EndpointSliceInterface {
return newEndpointSlices(c, namespace)
}
// NewForConfig creates a new DiscoveryV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*DiscoveryV1alpha1Client, error) {
// NewForConfig creates a new DiscoveryV1Client for the given config.
func NewForConfig(c *rest.Config) (*DiscoveryV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -48,12 +48,12 @@ func NewForConfig(c *rest.Config) (*DiscoveryV1alpha1Client, error) {
if err != nil {
return nil, err
}
return &DiscoveryV1alpha1Client{client}, nil
return &DiscoveryV1Client{client}, nil
}
// NewForConfigOrDie creates a new DiscoveryV1alpha1Client for the given config and
// NewForConfigOrDie creates a new DiscoveryV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *DiscoveryV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *DiscoveryV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -61,13 +61,13 @@ func NewForConfigOrDie(c *rest.Config) *DiscoveryV1alpha1Client {
return client
}
// New creates a new DiscoveryV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *DiscoveryV1alpha1Client {
return &DiscoveryV1alpha1Client{c}
// New creates a new DiscoveryV1Client for the given RESTClient.
func New(c rest.Interface) *DiscoveryV1Client {
return &DiscoveryV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -81,7 +81,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *DiscoveryV1alpha1Client) RESTClient() rest.Interface {
func (c *DiscoveryV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1

View File

@ -16,14 +16,14 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"context"
"time"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
scheme "k8s.io/client-go/kubernetes/scheme"
@ -38,14 +38,14 @@ type EndpointSlicesGetter interface {
// EndpointSliceInterface has methods to work with EndpointSlice resources.
type EndpointSliceInterface interface {
Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (*v1alpha1.EndpointSlice, error)
Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (*v1alpha1.EndpointSlice, 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) (*v1alpha1.EndpointSlice, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EndpointSliceList, 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 *v1alpha1.EndpointSlice, err error)
Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (*v1.EndpointSlice, error)
Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (*v1.EndpointSlice, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EndpointSlice, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error)
EndpointSliceExpansion
}
@ -56,7 +56,7 @@ type endpointSlices struct {
}
// newEndpointSlices returns a EndpointSlices
func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSlices {
func newEndpointSlices(c *DiscoveryV1Client, namespace string) *endpointSlices {
return &endpointSlices{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +64,8 @@ func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSl
}
// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any.
func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
@ -77,12 +77,12 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) {
func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.EndpointSliceList{}
result = &v1.EndpointSliceList{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
@ -94,7 +94,7 @@ func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result
}
// Watch returns a watch.Interface that watches the requested endpointSlices.
func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
func (c *endpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -109,8 +109,8 @@ func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.
}
// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Post().
Namespace(c.ns).
Resource("endpointslices").
@ -122,8 +122,8 @@ func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.End
}
// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Put().
Namespace(c.ns).
Resource("endpointslices").
@ -136,7 +136,7 @@ func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.End
}
// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs.
func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
func (c *endpointSlices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpointslices").
@ -147,7 +147,7 @@ func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.Delete
}
// DeleteCollection deletes a collection of objects.
func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
func (c *endpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
@ -163,8 +163,8 @@ func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOpt
}
// Patch applies the patch and returns the patched endpointSlice.
func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("endpointslices").

View File

@ -19,22 +19,22 @@ limitations under the License.
package fake
import (
v1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
v1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeDiscoveryV1alpha1 struct {
type FakeDiscoveryV1 struct {
*testing.Fake
}
func (c *FakeDiscoveryV1alpha1) EndpointSlices(namespace string) v1alpha1.EndpointSliceInterface {
func (c *FakeDiscoveryV1) EndpointSlices(namespace string) v1.EndpointSliceInterface {
return &FakeEndpointSlices{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeDiscoveryV1alpha1) RESTClient() rest.Interface {
func (c *FakeDiscoveryV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -32,29 +32,29 @@ import (
// FakeEndpointSlices implements EndpointSliceInterface
type FakeEndpointSlices struct {
Fake *FakeDiscoveryV1alpha1
Fake *FakeDiscoveryV1
ns string
}
var endpointslicesResource = schema.GroupVersionResource{Group: "discovery.k8s.io", Version: "v1alpha1", Resource: "endpointslices"}
var endpointslicesResource = schema.GroupVersionResource{Group: "discovery.k8s.io", Version: "v1", Resource: "endpointslices"}
var endpointslicesKind = schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1alpha1", Kind: "EndpointSlice"}
var endpointslicesKind = schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"}
// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any.
func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) {
func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *discoveryv1.EndpointSlice, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), &v1alpha1.EndpointSlice{})
Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), &discoveryv1.EndpointSlice{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.EndpointSlice), err
return obj.(*discoveryv1.EndpointSlice), err
}
// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) {
func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *discoveryv1.EndpointSliceList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), &v1alpha1.EndpointSliceList{})
Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), &discoveryv1.EndpointSliceList{})
if obj == nil {
return nil, err
@ -64,8 +64,8 @@ func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (res
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.EndpointSliceList{ListMeta: obj.(*v1alpha1.EndpointSliceList).ListMeta}
for _, item := range obj.(*v1alpha1.EndpointSliceList).Items {
list := &discoveryv1.EndpointSliceList{ListMeta: obj.(*discoveryv1.EndpointSliceList).ListMeta}
for _, item := range obj.(*discoveryv1.EndpointSliceList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -81,31 +81,31 @@ func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa
}
// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (result *v1alpha1.EndpointSlice, err error) {
func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts v1.CreateOptions) (result *discoveryv1.EndpointSlice, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), &v1alpha1.EndpointSlice{})
Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), &discoveryv1.EndpointSlice{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.EndpointSlice), err
return obj.(*discoveryv1.EndpointSlice), err
}
// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (result *v1alpha1.EndpointSlice, err error) {
func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts v1.UpdateOptions) (result *discoveryv1.EndpointSlice, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), &v1alpha1.EndpointSlice{})
Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), &discoveryv1.EndpointSlice{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.EndpointSlice), err
return obj.(*discoveryv1.EndpointSlice), err
}
// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs.
func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(endpointslicesResource, c.ns, name), &v1alpha1.EndpointSlice{})
Invokes(testing.NewDeleteAction(endpointslicesResource, c.ns, name), &discoveryv1.EndpointSlice{})
return err
}
@ -114,17 +114,17 @@ func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.De
func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.EndpointSliceList{})
_, err := c.Fake.Invokes(action, &discoveryv1.EndpointSliceList{})
return err
}
// Patch applies the patch and returns the patched endpointSlice.
func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error) {
func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *discoveryv1.EndpointSlice, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), &v1alpha1.EndpointSlice{})
Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), &discoveryv1.EndpointSlice{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.EndpointSlice), err
return obj.(*discoveryv1.EndpointSlice), err
}

View File

@ -16,6 +16,6 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
type EndpointSliceExpansion interface{}

View File

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/api/discovery/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type EndpointSliceLister interface {
// List lists all EndpointSlices in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.EndpointSlice, err error)
List(selector labels.Selector) (ret []*v1.EndpointSlice, err error)
// EndpointSlices returns an object that can list and get EndpointSlices.
EndpointSlices(namespace string) EndpointSliceNamespaceLister
EndpointSliceListerExpansion
@ -47,9 +47,9 @@ func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister {
}
// List lists all EndpointSlices in the indexer.
func (s *endpointSliceLister) List(selector labels.Selector) (ret []*v1alpha1.EndpointSlice, err error) {
func (s *endpointSliceLister) List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.EndpointSlice))
ret = append(ret, m.(*v1.EndpointSlice))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceName
type EndpointSliceNamespaceLister interface {
// List lists all EndpointSlices in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.EndpointSlice, err error)
List(selector labels.Selector) (ret []*v1.EndpointSlice, err error)
// Get retrieves the EndpointSlice from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.EndpointSlice, error)
Get(name string) (*v1.EndpointSlice, error)
EndpointSliceNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type endpointSliceNamespaceLister struct {
}
// List lists all EndpointSlices in the indexer for a given namespace.
func (s endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.EndpointSlice, err error) {
func (s endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.EndpointSlice))
ret = append(ret, m.(*v1.EndpointSlice))
})
return ret, err
}
// Get retrieves the EndpointSlice from the indexer for a given namespace and name.
func (s endpointSliceNamespaceLister) Get(name string) (*v1alpha1.EndpointSlice, error) {
func (s endpointSliceNamespaceLister) Get(name string) (*v1.EndpointSlice, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("endpointslice"), name)
return nil, errors.NewNotFound(v1.Resource("endpointslice"), name)
}
return obj.(*v1alpha1.EndpointSlice), nil
return obj.(*v1.EndpointSlice), nil
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1
// EndpointSliceListerExpansion allows custom methods to be added to
// EndpointSliceLister.