Merge pull request #99662 from swetharepakula/eps-ga-api-changes

Graduate EndpointSlice API to GA
This commit is contained in:
Kubernetes Prow Robot 2021-03-06 15:23:54 -08:00 committed by GitHub
commit 36244f31ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 2569 additions and 687 deletions

File diff suppressed because it is too large Load Diff

View File

@ -281,8 +281,8 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
{Group: "node.k8s.io", Version: "v1"}: {group: 16300, version: 15},
{Group: "node.k8s.io", Version: "v1alpha1"}: {group: 16300, version: 1},
{Group: "node.k8s.io", Version: "v1beta1"}: {group: 16300, version: 9},
{Group: "discovery.k8s.io", Version: "v1"}: {group: 16200, version: 15},
{Group: "discovery.k8s.io", Version: "v1beta1"}: {group: 16200, version: 12},
{Group: "discovery.k8s.io", Version: "v1alpha1"}: {group: 16200, version: 9},
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {group: 16100, version: 12},
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16100, version: 9},
{Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16000, version: 9},

View File

@ -84,7 +84,7 @@ certificates.k8s.io/v1 \
certificates.k8s.io/v1beta1 \
coordination.k8s.io/v1beta1 \
coordination.k8s.io/v1 \
discovery.k8s.io/v1alpha1 \
discovery.k8s.io/v1 \
discovery.k8s.io/v1beta1 \
extensions/v1beta1 \
events.k8s.io/v1 \

View File

@ -93,8 +93,8 @@ func TestDefaulting(t *testing.T) {
{Group: "batch", Version: "v2alpha1", Kind: "JobTemplate"}: {},
{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequest"}: {},
{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequestList"}: {},
{Group: "discovery.k8s.io", Version: "v1alpha1", Kind: "EndpointSlice"}: {},
{Group: "discovery.k8s.io", Version: "v1alpha1", Kind: "EndpointSliceList"}: {},
{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"}: {},
{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSliceList"}: {},
{Group: "discovery.k8s.io", Version: "v1beta1", Kind: "EndpointSlice"}: {},
{Group: "discovery.k8s.io", Version: "v1beta1", Kind: "EndpointSliceList"}: {},
{Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"}: {},

View File

@ -23,7 +23,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/discovery"
"k8s.io/kubernetes/pkg/apis/discovery/v1alpha1"
v1 "k8s.io/kubernetes/pkg/apis/discovery/v1"
"k8s.io/kubernetes/pkg/apis/discovery/v1beta1"
)
@ -34,7 +34,7 @@ func init() {
// Install registers the API group and adds types to a scheme
func Install(scheme *runtime.Scheme) {
utilruntime.Must(discovery.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(v1beta1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion, v1alpha1.SchemeGroupVersion))
utilruntime.Must(v1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion, v1.SchemeGroupVersion))
}

View File

@ -87,26 +87,19 @@ type Endpoint struct {
// endpoint.
// +optional
TargetRef *api.ObjectReference
// topology contains arbitrary topology information associated with the
// endpoint. These key/value pairs must conform with the label format.
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
// Topology may include a maximum of 16 key/value pairs. This includes, but
// is not limited to the following well known keys:
// * kubernetes.io/hostname: the value indicates the hostname of the node
// where the endpoint is located. This should match the corresponding
// node label.
// * topology.kubernetes.io/zone: the value indicates the zone where the
// endpoint is located. This should match the corresponding node label.
// * topology.kubernetes.io/region: the value indicates the region where the
// endpoint is located. This should match the corresponding node label.
// This field is deprecated and will be removed in future api versions.
// deprecatedTopology is deprecated and only retained for round-trip
// compatibility with v1beta1 Topology field. When v1beta1 is removed, this
// should be removed, too.
// +optional
Topology map[string]string
DeprecatedTopology map[string]string
// nodeName represents the name of the Node hosting this endpoint. This can
// be used to determine endpoints local to a Node. This field can be enabled
// with the EndpointSliceNodeName feature gate.
// +optional
NodeName *string
// zone is the name of the Zone this endpoint exists in.
// +optional
Zone *string
}
// EndpointConditions represents the current condition of an endpoint.

View File

@ -1,5 +1,5 @@
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
import (
v1 "k8s.io/api/core/v1"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
"k8s.io/apimachinery/pkg/runtime"
)
@ -31,7 +31,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
return RegisterDefaults(scheme)
}
func SetDefaults_EndpointPort(obj *discoveryv1alpha1.EndpointPort) {
func SetDefaults_EndpointPort(obj *discoveryv1.EndpointPort) {
if obj.Name == nil {
obj.Name = &defaultPortName
}

View File

@ -1,5 +1,5 @@
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1_test
package v1_test
import (
"testing"
"github.com/google/go-cmp/cmp"
v1 "k8s.io/api/core/v1"
discovery "k8s.io/api/discovery/v1alpha1"
discovery "k8s.io/api/discovery/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/kubernetes/pkg/api/legacyscheme"
_ "k8s.io/kubernetes/pkg/apis/discovery/install"

View File

@ -1,5 +1,5 @@
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -15,8 +15,8 @@ limitations under the License.
*/
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/discovery
// +k8s:conversion-gen-external-types=k8s.io/api/discovery/v1alpha1
// +k8s:conversion-gen-external-types=k8s.io/api/discovery/v1
// +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/discovery/v1alpha1
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/discovery/v1
package v1alpha1 // import "k8s.io/kubernetes/pkg/apis/discovery/v1alpha1"
package v1 // import "k8s.io/kubernetes/pkg/apis/discovery/v1"

View File

@ -1,5 +1,5 @@
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
import (
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@ -25,7 +25,7 @@ import (
const GroupName = "discovery.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
@ -33,7 +33,7 @@ func Resource(resource string) schema.GroupResource {
}
var (
localSchemeBuilder = &discoveryv1alpha1.SchemeBuilder
localSchemeBuilder = &discoveryv1.SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)

View File

@ -0,0 +1,226 @@
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1
import (
unsafe "unsafe"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/discovery/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
core "k8s.io/kubernetes/pkg/apis/core"
discovery "k8s.io/kubernetes/pkg/apis/discovery"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1.Endpoint)(nil), (*discovery.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Endpoint_To_discovery_Endpoint(a.(*v1.Endpoint), b.(*discovery.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.Endpoint)(nil), (*v1.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_Endpoint_To_v1_Endpoint(a.(*discovery.Endpoint), b.(*v1.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.EndpointConditions)(nil), (*discovery.EndpointConditions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_EndpointConditions_To_discovery_EndpointConditions(a.(*v1.EndpointConditions), b.(*discovery.EndpointConditions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointConditions)(nil), (*v1.EndpointConditions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointConditions_To_v1_EndpointConditions(a.(*discovery.EndpointConditions), b.(*v1.EndpointConditions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.EndpointPort)(nil), (*discovery.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_EndpointPort_To_discovery_EndpointPort(a.(*v1.EndpointPort), b.(*discovery.EndpointPort), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointPort)(nil), (*v1.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointPort_To_v1_EndpointPort(a.(*discovery.EndpointPort), b.(*v1.EndpointPort), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.EndpointSlice)(nil), (*discovery.EndpointSlice)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_EndpointSlice_To_discovery_EndpointSlice(a.(*v1.EndpointSlice), b.(*discovery.EndpointSlice), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointSlice)(nil), (*v1.EndpointSlice)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointSlice_To_v1_EndpointSlice(a.(*discovery.EndpointSlice), b.(*v1.EndpointSlice), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.EndpointSliceList)(nil), (*discovery.EndpointSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_EndpointSliceList_To_discovery_EndpointSliceList(a.(*v1.EndpointSliceList), b.(*discovery.EndpointSliceList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointSliceList)(nil), (*v1.EndpointSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointSliceList_To_v1_EndpointSliceList(a.(*discovery.EndpointSliceList), b.(*v1.EndpointSliceList), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1_Endpoint_To_discovery_Endpoint(in *v1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses))
if err := Convert_v1_EndpointConditions_To_discovery_EndpointConditions(&in.Conditions, &out.Conditions, s); err != nil {
return err
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*core.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.DeprecatedTopology = *(*map[string]string)(unsafe.Pointer(&in.DeprecatedTopology))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.Zone = (*string)(unsafe.Pointer(in.Zone))
return nil
}
// Convert_v1_Endpoint_To_discovery_Endpoint is an autogenerated conversion function.
func Convert_v1_Endpoint_To_discovery_Endpoint(in *v1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
return autoConvert_v1_Endpoint_To_discovery_Endpoint(in, out, s)
}
func autoConvert_discovery_Endpoint_To_v1_Endpoint(in *discovery.Endpoint, out *v1.Endpoint, s conversion.Scope) error {
out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses))
if err := Convert_discovery_EndpointConditions_To_v1_EndpointConditions(&in.Conditions, &out.Conditions, s); err != nil {
return err
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*corev1.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.DeprecatedTopology = *(*map[string]string)(unsafe.Pointer(&in.DeprecatedTopology))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.Zone = (*string)(unsafe.Pointer(in.Zone))
return nil
}
// Convert_discovery_Endpoint_To_v1_Endpoint is an autogenerated conversion function.
func Convert_discovery_Endpoint_To_v1_Endpoint(in *discovery.Endpoint, out *v1.Endpoint, s conversion.Scope) error {
return autoConvert_discovery_Endpoint_To_v1_Endpoint(in, out, s)
}
func autoConvert_v1_EndpointConditions_To_discovery_EndpointConditions(in *v1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error {
out.Ready = (*bool)(unsafe.Pointer(in.Ready))
out.Serving = (*bool)(unsafe.Pointer(in.Serving))
out.Terminating = (*bool)(unsafe.Pointer(in.Terminating))
return nil
}
// Convert_v1_EndpointConditions_To_discovery_EndpointConditions is an autogenerated conversion function.
func Convert_v1_EndpointConditions_To_discovery_EndpointConditions(in *v1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error {
return autoConvert_v1_EndpointConditions_To_discovery_EndpointConditions(in, out, s)
}
func autoConvert_discovery_EndpointConditions_To_v1_EndpointConditions(in *discovery.EndpointConditions, out *v1.EndpointConditions, s conversion.Scope) error {
out.Ready = (*bool)(unsafe.Pointer(in.Ready))
out.Serving = (*bool)(unsafe.Pointer(in.Serving))
out.Terminating = (*bool)(unsafe.Pointer(in.Terminating))
return nil
}
// Convert_discovery_EndpointConditions_To_v1_EndpointConditions is an autogenerated conversion function.
func Convert_discovery_EndpointConditions_To_v1_EndpointConditions(in *discovery.EndpointConditions, out *v1.EndpointConditions, s conversion.Scope) error {
return autoConvert_discovery_EndpointConditions_To_v1_EndpointConditions(in, out, s)
}
func autoConvert_v1_EndpointPort_To_discovery_EndpointPort(in *v1.EndpointPort, out *discovery.EndpointPort, s conversion.Scope) error {
out.Name = (*string)(unsafe.Pointer(in.Name))
out.Protocol = (*core.Protocol)(unsafe.Pointer(in.Protocol))
out.Port = (*int32)(unsafe.Pointer(in.Port))
out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol))
return nil
}
// Convert_v1_EndpointPort_To_discovery_EndpointPort is an autogenerated conversion function.
func Convert_v1_EndpointPort_To_discovery_EndpointPort(in *v1.EndpointPort, out *discovery.EndpointPort, s conversion.Scope) error {
return autoConvert_v1_EndpointPort_To_discovery_EndpointPort(in, out, s)
}
func autoConvert_discovery_EndpointPort_To_v1_EndpointPort(in *discovery.EndpointPort, out *v1.EndpointPort, s conversion.Scope) error {
out.Name = (*string)(unsafe.Pointer(in.Name))
out.Protocol = (*corev1.Protocol)(unsafe.Pointer(in.Protocol))
out.Port = (*int32)(unsafe.Pointer(in.Port))
out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol))
return nil
}
// Convert_discovery_EndpointPort_To_v1_EndpointPort is an autogenerated conversion function.
func Convert_discovery_EndpointPort_To_v1_EndpointPort(in *discovery.EndpointPort, out *v1.EndpointPort, s conversion.Scope) error {
return autoConvert_discovery_EndpointPort_To_v1_EndpointPort(in, out, s)
}
func autoConvert_v1_EndpointSlice_To_discovery_EndpointSlice(in *v1.EndpointSlice, out *discovery.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = discovery.AddressType(in.AddressType)
out.Endpoints = *(*[]discovery.Endpoint)(unsafe.Pointer(&in.Endpoints))
out.Ports = *(*[]discovery.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
// Convert_v1_EndpointSlice_To_discovery_EndpointSlice is an autogenerated conversion function.
func Convert_v1_EndpointSlice_To_discovery_EndpointSlice(in *v1.EndpointSlice, out *discovery.EndpointSlice, s conversion.Scope) error {
return autoConvert_v1_EndpointSlice_To_discovery_EndpointSlice(in, out, s)
}
func autoConvert_discovery_EndpointSlice_To_v1_EndpointSlice(in *discovery.EndpointSlice, out *v1.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = v1.AddressType(in.AddressType)
out.Endpoints = *(*[]v1.Endpoint)(unsafe.Pointer(&in.Endpoints))
out.Ports = *(*[]v1.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
// Convert_discovery_EndpointSlice_To_v1_EndpointSlice is an autogenerated conversion function.
func Convert_discovery_EndpointSlice_To_v1_EndpointSlice(in *discovery.EndpointSlice, out *v1.EndpointSlice, s conversion.Scope) error {
return autoConvert_discovery_EndpointSlice_To_v1_EndpointSlice(in, out, s)
}
func autoConvert_v1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1.EndpointSliceList, out *discovery.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]discovery.EndpointSlice)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_v1_EndpointSliceList_To_discovery_EndpointSliceList is an autogenerated conversion function.
func Convert_v1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1.EndpointSliceList, out *discovery.EndpointSliceList, s conversion.Scope) error {
return autoConvert_v1_EndpointSliceList_To_discovery_EndpointSliceList(in, out, s)
}
func autoConvert_discovery_EndpointSliceList_To_v1_EndpointSliceList(in *discovery.EndpointSliceList, out *v1.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]v1.EndpointSlice)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_discovery_EndpointSliceList_To_v1_EndpointSliceList is an autogenerated conversion function.
func Convert_discovery_EndpointSliceList_To_v1_EndpointSliceList(in *discovery.EndpointSliceList, out *v1.EndpointSliceList, s conversion.Scope) error {
return autoConvert_discovery_EndpointSliceList_To_v1_EndpointSliceList(in, out, s)
}

View File

@ -18,10 +18,10 @@ limitations under the License.
// Code generated by defaulter-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/api/discovery/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@ -29,19 +29,19 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
scheme.AddTypeDefaultingFunc(&v1alpha1.EndpointSlice{}, func(obj interface{}) { SetObjectDefaults_EndpointSlice(obj.(*v1alpha1.EndpointSlice)) })
scheme.AddTypeDefaultingFunc(&v1alpha1.EndpointSliceList{}, func(obj interface{}) { SetObjectDefaults_EndpointSliceList(obj.(*v1alpha1.EndpointSliceList)) })
scheme.AddTypeDefaultingFunc(&v1.EndpointSlice{}, func(obj interface{}) { SetObjectDefaults_EndpointSlice(obj.(*v1.EndpointSlice)) })
scheme.AddTypeDefaultingFunc(&v1.EndpointSliceList{}, func(obj interface{}) { SetObjectDefaults_EndpointSliceList(obj.(*v1.EndpointSliceList)) })
return nil
}
func SetObjectDefaults_EndpointSlice(in *v1alpha1.EndpointSlice) {
func SetObjectDefaults_EndpointSlice(in *v1.EndpointSlice) {
for i := range in.Ports {
a := &in.Ports[i]
SetDefaults_EndpointPort(a)
}
}
func SetObjectDefaults_EndpointSliceList(in *v1alpha1.EndpointSliceList) {
func SetObjectDefaults_EndpointSliceList(in *v1.EndpointSliceList) {
for i := range in.Items {
a := &in.Items[i]
SetObjectDefaults_EndpointSlice(a)

View File

@ -1,224 +0,0 @@
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1alpha1
import (
unsafe "unsafe"
v1 "k8s.io/api/core/v1"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
core "k8s.io/kubernetes/pkg/apis/core"
discovery "k8s.io/kubernetes/pkg/apis/discovery"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1alpha1.Endpoint)(nil), (*discovery.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_Endpoint_To_discovery_Endpoint(a.(*v1alpha1.Endpoint), b.(*discovery.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.Endpoint)(nil), (*v1alpha1.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_Endpoint_To_v1alpha1_Endpoint(a.(*discovery.Endpoint), b.(*v1alpha1.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.EndpointConditions)(nil), (*discovery.EndpointConditions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(a.(*v1alpha1.EndpointConditions), b.(*discovery.EndpointConditions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointConditions)(nil), (*v1alpha1.EndpointConditions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(a.(*discovery.EndpointConditions), b.(*v1alpha1.EndpointConditions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.EndpointPort)(nil), (*discovery.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_EndpointPort_To_discovery_EndpointPort(a.(*v1alpha1.EndpointPort), b.(*discovery.EndpointPort), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointPort)(nil), (*v1alpha1.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointPort_To_v1alpha1_EndpointPort(a.(*discovery.EndpointPort), b.(*v1alpha1.EndpointPort), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.EndpointSlice)(nil), (*discovery.EndpointSlice)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_EndpointSlice_To_discovery_EndpointSlice(a.(*v1alpha1.EndpointSlice), b.(*discovery.EndpointSlice), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointSlice)(nil), (*v1alpha1.EndpointSlice)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointSlice_To_v1alpha1_EndpointSlice(a.(*discovery.EndpointSlice), b.(*v1alpha1.EndpointSlice), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.EndpointSliceList)(nil), (*discovery.EndpointSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_EndpointSliceList_To_discovery_EndpointSliceList(a.(*v1alpha1.EndpointSliceList), b.(*discovery.EndpointSliceList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.EndpointSliceList)(nil), (*v1alpha1.EndpointSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_EndpointSliceList_To_v1alpha1_EndpointSliceList(a.(*discovery.EndpointSliceList), b.(*v1alpha1.EndpointSliceList), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1alpha1_Endpoint_To_discovery_Endpoint(in *v1alpha1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses))
if err := Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(&in.Conditions, &out.Conditions, s); err != nil {
return err
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*core.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.Topology = *(*map[string]string)(unsafe.Pointer(&in.Topology))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
return nil
}
// Convert_v1alpha1_Endpoint_To_discovery_Endpoint is an autogenerated conversion function.
func Convert_v1alpha1_Endpoint_To_discovery_Endpoint(in *v1alpha1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
return autoConvert_v1alpha1_Endpoint_To_discovery_Endpoint(in, out, s)
}
func autoConvert_discovery_Endpoint_To_v1alpha1_Endpoint(in *discovery.Endpoint, out *v1alpha1.Endpoint, s conversion.Scope) error {
out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses))
if err := Convert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(&in.Conditions, &out.Conditions, s); err != nil {
return err
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*v1.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.Topology = *(*map[string]string)(unsafe.Pointer(&in.Topology))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
return nil
}
// Convert_discovery_Endpoint_To_v1alpha1_Endpoint is an autogenerated conversion function.
func Convert_discovery_Endpoint_To_v1alpha1_Endpoint(in *discovery.Endpoint, out *v1alpha1.Endpoint, s conversion.Scope) error {
return autoConvert_discovery_Endpoint_To_v1alpha1_Endpoint(in, out, s)
}
func autoConvert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1alpha1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error {
out.Ready = (*bool)(unsafe.Pointer(in.Ready))
out.Serving = (*bool)(unsafe.Pointer(in.Serving))
out.Terminating = (*bool)(unsafe.Pointer(in.Terminating))
return nil
}
// Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions is an autogenerated conversion function.
func Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1alpha1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error {
return autoConvert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in, out, s)
}
func autoConvert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(in *discovery.EndpointConditions, out *v1alpha1.EndpointConditions, s conversion.Scope) error {
out.Ready = (*bool)(unsafe.Pointer(in.Ready))
out.Serving = (*bool)(unsafe.Pointer(in.Serving))
out.Terminating = (*bool)(unsafe.Pointer(in.Terminating))
return nil
}
// Convert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions is an autogenerated conversion function.
func Convert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(in *discovery.EndpointConditions, out *v1alpha1.EndpointConditions, s conversion.Scope) error {
return autoConvert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(in, out, s)
}
func autoConvert_v1alpha1_EndpointPort_To_discovery_EndpointPort(in *v1alpha1.EndpointPort, out *discovery.EndpointPort, s conversion.Scope) error {
out.Name = (*string)(unsafe.Pointer(in.Name))
out.Protocol = (*core.Protocol)(unsafe.Pointer(in.Protocol))
out.Port = (*int32)(unsafe.Pointer(in.Port))
out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol))
return nil
}
// Convert_v1alpha1_EndpointPort_To_discovery_EndpointPort is an autogenerated conversion function.
func Convert_v1alpha1_EndpointPort_To_discovery_EndpointPort(in *v1alpha1.EndpointPort, out *discovery.EndpointPort, s conversion.Scope) error {
return autoConvert_v1alpha1_EndpointPort_To_discovery_EndpointPort(in, out, s)
}
func autoConvert_discovery_EndpointPort_To_v1alpha1_EndpointPort(in *discovery.EndpointPort, out *v1alpha1.EndpointPort, s conversion.Scope) error {
out.Name = (*string)(unsafe.Pointer(in.Name))
out.Protocol = (*v1.Protocol)(unsafe.Pointer(in.Protocol))
out.Port = (*int32)(unsafe.Pointer(in.Port))
out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol))
return nil
}
// Convert_discovery_EndpointPort_To_v1alpha1_EndpointPort is an autogenerated conversion function.
func Convert_discovery_EndpointPort_To_v1alpha1_EndpointPort(in *discovery.EndpointPort, out *v1alpha1.EndpointPort, s conversion.Scope) error {
return autoConvert_discovery_EndpointPort_To_v1alpha1_EndpointPort(in, out, s)
}
func autoConvert_v1alpha1_EndpointSlice_To_discovery_EndpointSlice(in *v1alpha1.EndpointSlice, out *discovery.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = discovery.AddressType(in.AddressType)
out.Endpoints = *(*[]discovery.Endpoint)(unsafe.Pointer(&in.Endpoints))
out.Ports = *(*[]discovery.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
// Convert_v1alpha1_EndpointSlice_To_discovery_EndpointSlice is an autogenerated conversion function.
func Convert_v1alpha1_EndpointSlice_To_discovery_EndpointSlice(in *v1alpha1.EndpointSlice, out *discovery.EndpointSlice, s conversion.Scope) error {
return autoConvert_v1alpha1_EndpointSlice_To_discovery_EndpointSlice(in, out, s)
}
func autoConvert_discovery_EndpointSlice_To_v1alpha1_EndpointSlice(in *discovery.EndpointSlice, out *v1alpha1.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = v1alpha1.AddressType(in.AddressType)
out.Endpoints = *(*[]v1alpha1.Endpoint)(unsafe.Pointer(&in.Endpoints))
out.Ports = *(*[]v1alpha1.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
// Convert_discovery_EndpointSlice_To_v1alpha1_EndpointSlice is an autogenerated conversion function.
func Convert_discovery_EndpointSlice_To_v1alpha1_EndpointSlice(in *discovery.EndpointSlice, out *v1alpha1.EndpointSlice, s conversion.Scope) error {
return autoConvert_discovery_EndpointSlice_To_v1alpha1_EndpointSlice(in, out, s)
}
func autoConvert_v1alpha1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1alpha1.EndpointSliceList, out *discovery.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]discovery.EndpointSlice)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_v1alpha1_EndpointSliceList_To_discovery_EndpointSliceList is an autogenerated conversion function.
func Convert_v1alpha1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1alpha1.EndpointSliceList, out *discovery.EndpointSliceList, s conversion.Scope) error {
return autoConvert_v1alpha1_EndpointSliceList_To_discovery_EndpointSliceList(in, out, s)
}
func autoConvert_discovery_EndpointSliceList_To_v1alpha1_EndpointSliceList(in *discovery.EndpointSliceList, out *v1alpha1.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]v1alpha1.EndpointSlice)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_discovery_EndpointSliceList_To_v1alpha1_EndpointSliceList is an autogenerated conversion function.
func Convert_discovery_EndpointSliceList_To_v1alpha1_EndpointSliceList(in *discovery.EndpointSliceList, out *v1alpha1.EndpointSliceList, s conversion.Scope) error {
return autoConvert_discovery_EndpointSliceList_To_v1alpha1_EndpointSliceList(in, out, s)
}

View File

@ -0,0 +1,92 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/api/discovery/v1beta1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/kubernetes/pkg/apis/discovery"
)
func Convert_v1beta1_Endpoint_To_discovery_Endpoint(in *v1beta1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
if err := autoConvert_v1beta1_Endpoint_To_discovery_Endpoint(in, out, s); err != nil {
return err
}
if in.Topology != nil {
// Copy Topology into Deprecated Topology
out.DeprecatedTopology = make(map[string]string, len(in.Topology))
for k, v := range in.Topology {
out.DeprecatedTopology[k] = v
}
// Move zone from the topology map into a field
if zone, ok := in.Topology[corev1.LabelTopologyZone]; ok {
out.Zone = &zone
delete(out.DeprecatedTopology, corev1.LabelTopologyZone)
}
// Remove hostname from the topology map ONLY IF it is the same value as
// nodeName. This preserves the (rather odd) ability to have different
// values for topology[hostname] and nodename in v1beta1, without showing
// duplicate values in v1.
if node, ok := in.Topology[corev1.LabelHostname]; ok {
if out.NodeName != nil && node == *out.NodeName {
delete(out.DeprecatedTopology, corev1.LabelHostname)
}
}
// If zone & hostname were the only field in the map or topology was empty
// set DeprecatedTopology to nil
if len(out.DeprecatedTopology) == 0 {
out.DeprecatedTopology = nil
}
}
return nil
}
func Convert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint, out *v1beta1.Endpoint, s conversion.Scope) error {
if err := autoConvert_discovery_Endpoint_To_v1beta1_Endpoint(in, out, s); err != nil {
return err
}
// If no deprecated topology, zone or node field, no conversion is necessary
if in.DeprecatedTopology == nil && in.Zone == nil && in.NodeName == nil {
return nil
}
// Copy Deprecated Topology into Topology
out.Topology = make(map[string]string, len(in.DeprecatedTopology))
for k, v := range in.DeprecatedTopology {
out.Topology[k] = v
}
// Add zone field into the topology map
if in.Zone != nil {
out.Topology[corev1.LabelTopologyZone] = *in.Zone
}
// Add hostname into the topology map ONLY IF it is not already present.
// This preserves the (rather odd) ability to have different values for
// topology[hostname] and nodename in v1beta1.
if in.NodeName != nil && out.Topology[corev1.LabelHostname] == "" {
out.Topology[corev1.LabelHostname] = *in.NodeName
}
return nil
}

View File

@ -0,0 +1,145 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/discovery/v1beta1"
"k8s.io/kubernetes/pkg/apis/discovery"
utilpointer "k8s.io/utils/pointer"
)
func TestEndpointZoneConverstion(t *testing.T) {
testcases := []struct {
desc string
external v1beta1.Endpoint
internal discovery.Endpoint
}{
{
desc: "no topology field",
external: v1beta1.Endpoint{},
internal: discovery.Endpoint{},
},
{
desc: "non empty topology map, but no zone",
external: v1beta1.Endpoint{
Topology: map[string]string{
"key1": "val1",
},
},
internal: discovery.Endpoint{
DeprecatedTopology: map[string]string{
"key1": "val1",
},
},
},
{
desc: "non empty topology map, with zone",
external: v1beta1.Endpoint{
Topology: map[string]string{
"key1": "val1",
corev1.LabelTopologyZone: "zone1",
},
},
internal: discovery.Endpoint{
DeprecatedTopology: map[string]string{
"key1": "val1",
},
Zone: utilpointer.StringPtr("zone1"),
},
},
{
desc: "only zone in topology map",
external: v1beta1.Endpoint{
Topology: map[string]string{
corev1.LabelTopologyZone: "zone1",
},
},
internal: discovery.Endpoint{
Zone: utilpointer.StringPtr("zone1"),
},
},
{
desc: "nodeName and topology[hostname] are populated with different values",
external: v1beta1.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
Topology: map[string]string{
corev1.LabelHostname: "node-2",
},
},
internal: discovery.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{
corev1.LabelHostname: "node-2",
},
},
},
{
desc: "nodeName and topology[hostname] are populated with same values",
external: v1beta1.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
Topology: map[string]string{
corev1.LabelHostname: "node-1",
},
},
internal: discovery.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
},
},
{
desc: "only topology[hostname] is populated",
external: v1beta1.Endpoint{
Topology: map[string]string{
corev1.LabelHostname: "node-1",
},
},
internal: discovery.Endpoint{
DeprecatedTopology: map[string]string{
corev1.LabelHostname: "node-1",
},
},
},
{
desc: "only nodeName is populated",
external: v1beta1.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
Topology: map[string]string{
corev1.LabelHostname: "node-1",
},
},
internal: discovery.Endpoint{
NodeName: utilpointer.StringPtr("node-1"),
},
},
}
for _, tc := range testcases {
t.Run(tc.desc, func(t *testing.T) {
convertedInternal := discovery.Endpoint{}
require.NoError(t, Convert_v1beta1_Endpoint_To_discovery_Endpoint(&tc.external, &convertedInternal, nil))
assert.Equal(t, tc.internal, convertedInternal, "v1beta1.Endpoint -> discovery.Endpoint")
convertedV1beta1 := v1beta1.Endpoint{}
require.NoError(t, Convert_discovery_Endpoint_To_v1beta1_Endpoint(&tc.internal, &convertedV1beta1, nil))
assert.Equal(t, tc.external, convertedV1beta1, "discovery.Endpoint -> v1beta1.Endpoint")
})
}
}

View File

@ -38,16 +38,6 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1beta1.Endpoint)(nil), (*discovery.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Endpoint_To_discovery_Endpoint(a.(*v1beta1.Endpoint), b.(*discovery.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*discovery.Endpoint)(nil), (*v1beta1.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_Endpoint_To_v1beta1_Endpoint(a.(*discovery.Endpoint), b.(*v1beta1.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1beta1.EndpointConditions)(nil), (*discovery.EndpointConditions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(a.(*v1beta1.EndpointConditions), b.(*discovery.EndpointConditions), scope)
}); err != nil {
@ -88,6 +78,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddConversionFunc((*discovery.Endpoint)(nil), (*v1beta1.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_discovery_Endpoint_To_v1beta1_Endpoint(a.(*discovery.Endpoint), b.(*v1beta1.Endpoint), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*v1beta1.Endpoint)(nil), (*discovery.Endpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Endpoint_To_discovery_Endpoint(a.(*v1beta1.Endpoint), b.(*discovery.Endpoint), scope)
}); err != nil {
return err
}
return nil
}
@ -98,16 +98,11 @@ func autoConvert_v1beta1_Endpoint_To_discovery_Endpoint(in *v1beta1.Endpoint, ou
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*core.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.Topology = *(*map[string]string)(unsafe.Pointer(&in.Topology))
// WARNING: in.Topology requires manual conversion: does not exist in peer-type
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
return nil
}
// Convert_v1beta1_Endpoint_To_discovery_Endpoint is an autogenerated conversion function.
func Convert_v1beta1_Endpoint_To_discovery_Endpoint(in *v1beta1.Endpoint, out *discovery.Endpoint, s conversion.Scope) error {
return autoConvert_v1beta1_Endpoint_To_discovery_Endpoint(in, out, s)
}
func autoConvert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint, out *v1beta1.Endpoint, s conversion.Scope) error {
out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses))
if err := Convert_discovery_EndpointConditions_To_v1beta1_EndpointConditions(&in.Conditions, &out.Conditions, s); err != nil {
@ -115,16 +110,12 @@ func autoConvert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint,
}
out.Hostname = (*string)(unsafe.Pointer(in.Hostname))
out.TargetRef = (*v1.ObjectReference)(unsafe.Pointer(in.TargetRef))
out.Topology = *(*map[string]string)(unsafe.Pointer(&in.Topology))
// WARNING: in.DeprecatedTopology requires manual conversion: does not exist in peer-type
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
// WARNING: in.Zone requires manual conversion: does not exist in peer-type
return nil
}
// Convert_discovery_Endpoint_To_v1beta1_Endpoint is an autogenerated conversion function.
func Convert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint, out *v1beta1.Endpoint, s conversion.Scope) error {
return autoConvert_discovery_Endpoint_To_v1beta1_Endpoint(in, out, s)
}
func autoConvert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(in *v1beta1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error {
out.Ready = (*bool)(unsafe.Pointer(in.Ready))
out.Serving = (*bool)(unsafe.Pointer(in.Serving))
@ -178,7 +169,17 @@ func Convert_discovery_EndpointPort_To_v1beta1_EndpointPort(in *discovery.Endpoi
func autoConvert_v1beta1_EndpointSlice_To_discovery_EndpointSlice(in *v1beta1.EndpointSlice, out *discovery.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = discovery.AddressType(in.AddressType)
out.Endpoints = *(*[]discovery.Endpoint)(unsafe.Pointer(&in.Endpoints))
if in.Endpoints != nil {
in, out := &in.Endpoints, &out.Endpoints
*out = make([]discovery.Endpoint, len(*in))
for i := range *in {
if err := Convert_v1beta1_Endpoint_To_discovery_Endpoint(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Endpoints = nil
}
out.Ports = *(*[]discovery.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
@ -191,7 +192,17 @@ func Convert_v1beta1_EndpointSlice_To_discovery_EndpointSlice(in *v1beta1.Endpoi
func autoConvert_discovery_EndpointSlice_To_v1beta1_EndpointSlice(in *discovery.EndpointSlice, out *v1beta1.EndpointSlice, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.AddressType = v1beta1.AddressType(in.AddressType)
out.Endpoints = *(*[]v1beta1.Endpoint)(unsafe.Pointer(&in.Endpoints))
if in.Endpoints != nil {
in, out := &in.Endpoints, &out.Endpoints
*out = make([]v1beta1.Endpoint, len(*in))
for i := range *in {
if err := Convert_discovery_Endpoint_To_v1beta1_Endpoint(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Endpoints = nil
}
out.Ports = *(*[]v1beta1.EndpointPort)(unsafe.Pointer(&in.Ports))
return nil
}
@ -203,7 +214,17 @@ func Convert_discovery_EndpointSlice_To_v1beta1_EndpointSlice(in *discovery.Endp
func autoConvert_v1beta1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1beta1.EndpointSliceList, out *discovery.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]discovery.EndpointSlice)(unsafe.Pointer(&in.Items))
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]discovery.EndpointSlice, len(*in))
for i := range *in {
if err := Convert_v1beta1_EndpointSlice_To_discovery_EndpointSlice(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
@ -214,7 +235,17 @@ func Convert_v1beta1_EndpointSliceList_To_discovery_EndpointSliceList(in *v1beta
func autoConvert_discovery_EndpointSliceList_To_v1beta1_EndpointSliceList(in *discovery.EndpointSliceList, out *v1beta1.EndpointSliceList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]v1beta1.EndpointSlice)(unsafe.Pointer(&in.Items))
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]v1beta1.EndpointSlice, len(*in))
for i := range *in {
if err := Convert_discovery_EndpointSlice_To_v1beta1_EndpointSlice(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}

View File

@ -17,6 +17,9 @@ limitations under the License.
package validation
import (
"fmt"
corev1 "k8s.io/api/core/v1"
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
metavalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/util/sets"
@ -110,11 +113,14 @@ func validateEndpoints(endpoints []discovery.Endpoint, addrType discovery.Addres
}
}
topologyPath := idxPath.Child("topology")
if len(endpoint.Topology) > maxTopologyLabels {
allErrs = append(allErrs, field.TooMany(topologyPath, len(endpoint.Topology), maxTopologyLabels))
topologyPath := idxPath.Child("deprecatedTopology")
if len(endpoint.DeprecatedTopology) > maxTopologyLabels {
allErrs = append(allErrs, field.TooMany(topologyPath, len(endpoint.DeprecatedTopology), maxTopologyLabels))
}
allErrs = append(allErrs, metavalidation.ValidateLabels(endpoint.DeprecatedTopology, topologyPath)...)
if _, found := endpoint.DeprecatedTopology[corev1.LabelTopologyZone]; found {
allErrs = append(allErrs, field.InternalError(topologyPath.Key(corev1.LabelTopologyZone), fmt.Errorf("reserved key was not removed in conversion")))
}
allErrs = append(allErrs, metavalidation.ValidateLabels(endpoint.Topology, topologyPath)...)
if endpoint.Hostname != nil {
allErrs = append(allErrs, apivalidation.ValidateDNS1123Label(*endpoint.Hostname, idxPath.Child("hostname"))...)

View File

@ -21,6 +21,7 @@ import (
"strings"
"testing"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/discovery"
@ -197,8 +198,8 @@ func TestValidateEndpointSlice(t *testing.T) {
Protocol: protocolPtr(api.ProtocolTCP),
}},
Endpoints: []discovery.Endpoint{{
Addresses: generateIPAddresses(1),
Topology: generateTopology(maxTopologyLabels),
Addresses: generateIPAddresses(1),
DeprecatedTopology: generateTopology(maxTopologyLabels),
}},
},
},
@ -321,8 +322,8 @@ func TestValidateEndpointSlice(t *testing.T) {
Protocol: protocolPtr(api.ProtocolTCP),
}},
Endpoints: []discovery.Endpoint{{
Addresses: generateIPAddresses(1),
Topology: map[string]string{"--INVALID": "example"},
Addresses: generateIPAddresses(1),
DeprecatedTopology: map[string]string{"--INVALID": "example"},
}},
},
},
@ -336,8 +337,8 @@ func TestValidateEndpointSlice(t *testing.T) {
Protocol: protocolPtr(api.ProtocolTCP),
}},
Endpoints: []discovery.Endpoint{{
Addresses: generateIPAddresses(1),
Topology: generateTopology(maxTopologyLabels + 1),
Addresses: generateIPAddresses(1),
DeprecatedTopology: generateTopology(maxTopologyLabels + 1),
}},
},
},
@ -454,6 +455,21 @@ func TestValidateEndpointSlice(t *testing.T) {
expectedErrors: 3,
endpointSlice: &discovery.EndpointSlice{},
},
"zone-key-topology": {
expectedErrors: 1,
endpointSlice: &discovery.EndpointSlice{
ObjectMeta: standardMeta,
AddressType: discovery.AddressTypeIPv4,
Ports: []discovery.EndpointPort{{
Name: utilpointer.StringPtr("http"),
Protocol: protocolPtr(api.ProtocolTCP),
}},
Endpoints: []discovery.Endpoint{{
Addresses: generateIPAddresses(1),
DeprecatedTopology: map[string]string{corev1.LabelTopologyZone: "zone1"},
}},
},
},
}
for name, testCase := range testCases {

View File

@ -44,8 +44,8 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) {
*out = new(core.ObjectReference)
**out = **in
}
if in.Topology != nil {
in, out := &in.Topology, &out.Topology
if in.DeprecatedTopology != nil {
in, out := &in.DeprecatedTopology, &out.DeprecatedTopology
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
@ -56,6 +56,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) {
*out = new(string)
**out = **in
}
if in.Zone != nil {
in, out := &in.Zone, &out.Zone
*out = new(string)
**out = **in
}
return
}

View File

@ -43,6 +43,7 @@ import (
coordinationapiv1 "k8s.io/api/coordination/v1"
coordinationapiv1beta1 "k8s.io/api/coordination/v1beta1"
apiv1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
@ -685,6 +686,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
certificatesapiv1beta1.SchemeGroupVersion,
coordinationapiv1.SchemeGroupVersion,
coordinationapiv1beta1.SchemeGroupVersion,
discoveryv1.SchemeGroupVersion,
discoveryv1beta1.SchemeGroupVersion,
eventsv1.SchemeGroupVersion,
eventsv1beta1.SchemeGroupVersion,

View File

@ -67,6 +67,7 @@ var GVRToStorageVersionHash = map[string]string{
"certificates.k8s.io/v1beta1/certificatesigningrequests": "95fRKMXA+00=",
"coordination.k8s.io/v1beta1/leases": "gqkMMb/YqFM=",
"coordination.k8s.io/v1/leases": "gqkMMb/YqFM=",
"discovery.k8s.io/v1/endpointslices": "Nx3SIv6I0mE=",
"discovery.k8s.io/v1beta1/endpointslices": "Nx3SIv6I0mE=",
"extensions/v1beta1/ingresses": "ZOAfGflaKd0=",
"networking.k8s.io/v1/networkpolicies": "YpfwF18m1G8=",

View File

@ -19,10 +19,13 @@ package endpointslice
import (
"context"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/storage/names"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/api/legacyscheme"
@ -51,6 +54,7 @@ func (endpointSliceStrategy) PrepareForCreate(ctx context.Context, obj runtime.O
endpointSlice.Generation = 1
dropDisabledFieldsOnCreate(endpointSlice)
dropTopologyOnV1(ctx, nil, endpointSlice)
}
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
@ -62,8 +66,8 @@ func (endpointSliceStrategy) PrepareForUpdate(ctx context.Context, obj, old runt
// This needs to be changed if a status attribute is added to EndpointSlice
ogNewMeta := newEPS.ObjectMeta
ogOldMeta := oldEPS.ObjectMeta
newEPS.ObjectMeta = v1.ObjectMeta{}
oldEPS.ObjectMeta = v1.ObjectMeta{}
newEPS.ObjectMeta = metav1.ObjectMeta{}
oldEPS.ObjectMeta = metav1.ObjectMeta{}
if !apiequality.Semantic.DeepEqual(newEPS, oldEPS) || !apiequality.Semantic.DeepEqual(ogNewMeta.Labels, ogOldMeta.Labels) {
ogNewMeta.Generation = ogOldMeta.Generation + 1
@ -73,6 +77,7 @@ func (endpointSliceStrategy) PrepareForUpdate(ctx context.Context, obj, old runt
oldEPS.ObjectMeta = ogOldMeta
dropDisabledFieldsOnUpdate(oldEPS, newEPS)
dropTopologyOnV1(ctx, oldEPS, newEPS)
}
// Validate validates a new EndpointSlice.
@ -139,3 +144,26 @@ func dropDisabledFieldsOnUpdate(oldEPS, newEPS *discovery.EndpointSlice) {
}
}
}
// dropTopologyOnV1 on V1 request wipes the DeprecatedTopology field and copies
// the NodeName value into DeprecatedTopology
func dropTopologyOnV1(ctx context.Context, oldEPS, newEPS *discovery.EndpointSlice) {
if info, ok := genericapirequest.RequestInfoFrom(ctx); ok {
requestGV := schema.GroupVersion{Group: info.APIGroup, Version: info.APIVersion}
if requestGV == discoveryv1beta1.SchemeGroupVersion {
return
}
// do not drop topology if endpoints have not been changed
if oldEPS != nil && apiequality.Semantic.DeepEqual(oldEPS.Endpoints, newEPS.Endpoints) {
return
}
for i := range newEPS.Endpoints {
ep := &newEPS.Endpoints[i]
//Silently clear out DeprecatedTopology
ep.DeprecatedTopology = nil
}
}
}

View File

@ -20,8 +20,10 @@ import (
"context"
"testing"
corev1 "k8s.io/api/core/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kubernetes/pkg/apis/discovery"
@ -628,3 +630,241 @@ func TestPrepareForUpdate(t *testing.T) {
})
}
}
func Test_dropTopologyOnV1(t *testing.T) {
testcases := []struct {
name string
v1Request bool
newEPS *discovery.EndpointSlice
originalEPS *discovery.EndpointSlice
expectedEPS *discovery.EndpointSlice
}{
{
name: "v1 request, without deprecated topology",
v1Request: true,
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{Hostname: utilpointer.StringPtr("hostname-1")},
{Hostname: utilpointer.StringPtr("hostname-1")},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{Hostname: utilpointer.StringPtr("hostname-1")},
{Hostname: utilpointer.StringPtr("hostname-1")},
},
},
},
{
name: "v1beta1 request, without deprecated topology",
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{Hostname: utilpointer.StringPtr("hostname-1")},
{Hostname: utilpointer.StringPtr("hostname-1")},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{Hostname: utilpointer.StringPtr("hostname-1")},
{Hostname: utilpointer.StringPtr("hostname-1")},
},
},
},
{
name: "v1 request, with deprecated topology",
v1Request: true,
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{DeprecatedTopology: map[string]string{"key": "value"}},
{DeprecatedTopology: map[string]string{"key": "value"}},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{{}, {}},
},
},
{
name: "v1beta1 request, with deprecated topology",
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{DeprecatedTopology: map[string]string{"key": "value"}},
{DeprecatedTopology: map[string]string{"key": "value"}},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{DeprecatedTopology: map[string]string{"key": "value"}},
{DeprecatedTopology: map[string]string{"key": "value"}},
},
},
},
{
name: "v1 request, updated metadata",
v1Request: true,
originalEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
newEPS: &discovery.EndpointSlice{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"example": "one"},
},
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
expectedEPS: &discovery.EndpointSlice{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"example": "one"},
},
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
},
{
name: "v1beta1 request, updated metadata",
originalEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
newEPS: &discovery.EndpointSlice{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"example": "one"},
},
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
expectedEPS: &discovery.EndpointSlice{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"example": "one"},
},
Endpoints: []discovery.Endpoint{
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
{
NodeName: utilpointer.StringPtr("node-1"),
DeprecatedTopology: map[string]string{"key": "value"},
},
},
},
},
{
name: "v1 request, updated endpoints",
v1Request: true,
originalEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{DeprecatedTopology: map[string]string{"key": "value"}},
{DeprecatedTopology: map[string]string{"key": "value"}},
},
},
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{Hostname: utilpointer.StringPtr("hostname-1")},
{Hostname: utilpointer.StringPtr("hostname-1")},
},
},
},
{
name: "v1beta1 request, updated endpoints",
originalEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{DeprecatedTopology: map[string]string{"key": "value"}},
{DeprecatedTopology: map[string]string{"key": "value"}},
},
},
newEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
},
},
expectedEPS: &discovery.EndpointSlice{
Endpoints: []discovery.Endpoint{
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
{
Hostname: utilpointer.StringPtr("hostname-1"),
DeprecatedTopology: map[string]string{corev1.LabelHostname: "node-1"},
},
},
},
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
ctx := genericapirequest.WithRequestInfo(genericapirequest.NewContext(), &genericapirequest.RequestInfo{APIGroup: "discovery.k8s.io", APIVersion: "v1beta1", Resource: "endpointslices"})
if tc.v1Request {
ctx = genericapirequest.WithRequestInfo(genericapirequest.NewContext(), &genericapirequest.RequestInfo{APIGroup: "discovery.k8s.io", APIVersion: "v1", Resource: "endpointslices"})
}
dropTopologyOnV1(ctx, tc.originalEPS, tc.newEPS)
if !apiequality.Semantic.DeepEqual(tc.newEPS, tc.expectedEPS) {
t.Logf("actual endpointslice: %v", tc.newEPS)
t.Logf("expected endpointslice: %v", tc.expectedEPS)
t.Errorf("unexpected EndpointSlice on API topology strategy")
}
})
}
}

View File

@ -17,7 +17,7 @@ limitations under the License.
package rest
import (
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
@ -37,14 +37,6 @@ func (p StorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.AP
// If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities.
// TODO refactor the plumbing to provide the information in the APIGroupInfo
if apiResourceConfigSource.VersionEnabled(discoveryv1alpha1.SchemeGroupVersion) {
storageMap, err := p.v1alpha1Storage(apiResourceConfigSource, restOptionsGetter)
if err != nil {
return genericapiserver.APIGroupInfo{}, false, err
}
apiGroupInfo.VersionedResourcesStorageMap[discoveryv1alpha1.SchemeGroupVersion.Version] = storageMap
}
if apiResourceConfigSource.VersionEnabled(discoveryv1beta1.SchemeGroupVersion) {
storageMap, err := p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
if err != nil {
@ -53,10 +45,18 @@ func (p StorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.AP
apiGroupInfo.VersionedResourcesStorageMap[discoveryv1beta1.SchemeGroupVersion.Version] = storageMap
}
if apiResourceConfigSource.VersionEnabled(discoveryv1.SchemeGroupVersion) {
storageMap, err := p.v1Storage(apiResourceConfigSource, restOptionsGetter)
if err != nil {
return genericapiserver.APIGroupInfo{}, false, err
}
apiGroupInfo.VersionedResourcesStorageMap[discoveryv1.SchemeGroupVersion.Version] = storageMap
}
return apiGroupInfo, true, nil
}
func (p StorageProvider) v1alpha1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
func (p StorageProvider) v1beta1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
storage := map[string]rest.Storage{}
endpointSliceStorage, err := endpointslicestorage.NewREST(restOptionsGetter)
@ -68,7 +68,7 @@ func (p StorageProvider) v1alpha1Storage(apiResourceConfigSource serverstorage.A
return storage, err
}
func (p StorageProvider) v1beta1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
func (p StorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
storage := map[string]rest.Storage{}
endpointSliceStorage, err := endpointslicestorage.NewREST(restOptionsGetter)

View File

@ -19,4 +19,4 @@ limitations under the License.
// +k8s:openapi-gen=true
// +groupName=discovery.k8s.io
package v1alpha1 // import "k8s.io/api/discovery/v1alpha1"
package v1 // import "k8s.io/api/discovery/v1"

View File

@ -15,9 +15,9 @@ limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1alpha1/generated.proto
// source: k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1/generated.proto
package v1alpha1
package v1
import (
fmt "fmt"
@ -49,7 +49,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *Endpoint) Reset() { *m = Endpoint{} }
func (*Endpoint) ProtoMessage() {}
func (*Endpoint) Descriptor() ([]byte, []int) {
return fileDescriptor_772f83c5b34e07a5, []int{0}
return fileDescriptor_3a5d310fb1396ddf, []int{0}
}
func (m *Endpoint) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -77,7 +77,7 @@ var xxx_messageInfo_Endpoint proto.InternalMessageInfo
func (m *EndpointConditions) Reset() { *m = EndpointConditions{} }
func (*EndpointConditions) ProtoMessage() {}
func (*EndpointConditions) Descriptor() ([]byte, []int) {
return fileDescriptor_772f83c5b34e07a5, []int{1}
return fileDescriptor_3a5d310fb1396ddf, []int{1}
}
func (m *EndpointConditions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -105,7 +105,7 @@ var xxx_messageInfo_EndpointConditions proto.InternalMessageInfo
func (m *EndpointPort) Reset() { *m = EndpointPort{} }
func (*EndpointPort) ProtoMessage() {}
func (*EndpointPort) Descriptor() ([]byte, []int) {
return fileDescriptor_772f83c5b34e07a5, []int{2}
return fileDescriptor_3a5d310fb1396ddf, []int{2}
}
func (m *EndpointPort) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -133,7 +133,7 @@ var xxx_messageInfo_EndpointPort proto.InternalMessageInfo
func (m *EndpointSlice) Reset() { *m = EndpointSlice{} }
func (*EndpointSlice) ProtoMessage() {}
func (*EndpointSlice) Descriptor() ([]byte, []int) {
return fileDescriptor_772f83c5b34e07a5, []int{3}
return fileDescriptor_3a5d310fb1396ddf, []int{3}
}
func (m *EndpointSlice) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -161,7 +161,7 @@ var xxx_messageInfo_EndpointSlice proto.InternalMessageInfo
func (m *EndpointSliceList) Reset() { *m = EndpointSliceList{} }
func (*EndpointSliceList) ProtoMessage() {}
func (*EndpointSliceList) Descriptor() ([]byte, []int) {
return fileDescriptor_772f83c5b34e07a5, []int{4}
return fileDescriptor_3a5d310fb1396ddf, []int{4}
}
func (m *EndpointSliceList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -187,71 +187,72 @@ func (m *EndpointSliceList) XXX_DiscardUnknown() {
var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo
func init() {
proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1alpha1.Endpoint")
proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1alpha1.Endpoint.TopologyEntry")
proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1alpha1.EndpointConditions")
proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1alpha1.EndpointPort")
proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1alpha1.EndpointSlice")
proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1alpha1.EndpointSliceList")
proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1.Endpoint")
proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1.Endpoint.DeprecatedTopologyEntry")
proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1.EndpointConditions")
proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1.EndpointPort")
proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1.EndpointSlice")
proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1.EndpointSliceList")
}
func init() {
proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1alpha1/generated.proto", fileDescriptor_772f83c5b34e07a5)
proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1/generated.proto", fileDescriptor_3a5d310fb1396ddf)
}
var fileDescriptor_772f83c5b34e07a5 = []byte{
// 801 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x8f, 0xe3, 0x44,
0x10, 0x8d, 0x27, 0x13, 0xd6, 0xee, 0xec, 0x88, 0xdd, 0x16, 0x87, 0x68, 0x00, 0x7b, 0x14, 0x84,
0x88, 0x34, 0xd0, 0x26, 0x23, 0x40, 0x2b, 0x38, 0x8d, 0x61, 0xf9, 0x90, 0x60, 0x19, 0x7a, 0xe7,
0x80, 0x10, 0x07, 0x7a, 0xec, 0x5a, 0xc7, 0x24, 0x76, 0x5b, 0xdd, 0x9d, 0x48, 0xb9, 0xf1, 0x0f,
0xe0, 0x47, 0x21, 0x34, 0xc7, 0x3d, 0xee, 0xc9, 0x62, 0xbc, 0x12, 0x3f, 0x62, 0x4f, 0xa8, 0xdb,
0x9f, 0x43, 0x80, 0xcd, 0xcd, 0xfd, 0xaa, 0xde, 0xab, 0x7a, 0xe5, 0x2a, 0xf4, 0xf9, 0xf2, 0x81,
0x24, 0x09, 0xf7, 0x97, 0xeb, 0x2b, 0x10, 0x19, 0x28, 0x90, 0xfe, 0x06, 0xb2, 0x88, 0x0b, 0xbf,
0x0e, 0xb0, 0x3c, 0xf1, 0xa3, 0x44, 0x86, 0x7c, 0x03, 0x62, 0xeb, 0x6f, 0xe6, 0x6c, 0x95, 0x2f,
0xd8, 0xdc, 0x8f, 0x21, 0x03, 0xc1, 0x14, 0x44, 0x24, 0x17, 0x5c, 0x71, 0xfc, 0x66, 0x95, 0x4e,
0x58, 0x9e, 0x90, 0x36, 0x9d, 0x34, 0xe9, 0xc7, 0xef, 0xc5, 0x89, 0x5a, 0xac, 0xaf, 0x48, 0xc8,
0x53, 0x3f, 0xe6, 0x31, 0xf7, 0x0d, 0xeb, 0x6a, 0xfd, 0xc4, 0xbc, 0xcc, 0xc3, 0x7c, 0x55, 0x6a,
0xc7, 0xd3, 0x5e, 0xf1, 0x90, 0x0b, 0xf0, 0x37, 0x3b, 0x15, 0x8f, 0x3f, 0xe8, 0x72, 0x52, 0x16,
0x2e, 0x92, 0x4c, 0xf7, 0x97, 0x2f, 0x63, 0x0d, 0x48, 0x3f, 0x05, 0xc5, 0xfe, 0x8d, 0xe5, 0xff,
0x17, 0x4b, 0xac, 0x33, 0x95, 0xa4, 0xb0, 0x43, 0xf8, 0xe8, 0x65, 0x04, 0x19, 0x2e, 0x20, 0x65,
0xff, 0xe4, 0x4d, 0xff, 0x1a, 0x22, 0xfb, 0x61, 0x16, 0xe5, 0x3c, 0xc9, 0x14, 0x3e, 0x45, 0x0e,
0x8b, 0x22, 0x01, 0x52, 0x82, 0x9c, 0x58, 0x27, 0xc3, 0x99, 0x13, 0x1c, 0x95, 0x85, 0xe7, 0x9c,
0x37, 0x20, 0xed, 0xe2, 0x18, 0x10, 0x0a, 0x79, 0x16, 0x25, 0x2a, 0xe1, 0x99, 0x9c, 0x1c, 0x9c,
0x58, 0xb3, 0xf1, 0xd9, 0x9c, 0xfc, 0xef, 0x7c, 0x49, 0x53, 0xe9, 0xd3, 0x96, 0x18, 0xe0, 0xeb,
0xc2, 0x1b, 0x94, 0x85, 0x87, 0x3a, 0x8c, 0xf6, 0x84, 0xf1, 0x0c, 0xd9, 0x0b, 0x2e, 0x55, 0xc6,
0x52, 0x98, 0x0c, 0x4f, 0xac, 0x99, 0x13, 0xdc, 0x2d, 0x0b, 0xcf, 0xfe, 0xb2, 0xc6, 0x68, 0x1b,
0xc5, 0x17, 0xc8, 0x51, 0x4c, 0xc4, 0xa0, 0x28, 0x3c, 0x99, 0x1c, 0x9a, 0x7e, 0xde, 0xea, 0xf7,
0xa3, 0xff, 0x10, 0xd9, 0xcc, 0xc9, 0xb7, 0x57, 0x3f, 0x43, 0xa8, 0x93, 0x40, 0x40, 0x16, 0x42,
0x65, 0xf1, 0xb2, 0x61, 0xd2, 0x4e, 0x04, 0x87, 0xc8, 0x56, 0x3c, 0xe7, 0x2b, 0x1e, 0x6f, 0x27,
0xa3, 0x93, 0xe1, 0x6c, 0x7c, 0xf6, 0xe1, 0x9e, 0x06, 0xc9, 0x65, 0xcd, 0x7b, 0x98, 0x29, 0xb1,
0x0d, 0xee, 0xd5, 0x26, 0xed, 0x06, 0xa6, 0xad, 0xb0, 0x36, 0x98, 0xf1, 0x08, 0x1e, 0x69, 0x83,
0xaf, 0x74, 0x06, 0x1f, 0xd5, 0x18, 0x6d, 0xa3, 0xc7, 0x9f, 0xa0, 0xa3, 0x5b, 0xb2, 0xf8, 0x1e,
0x1a, 0x2e, 0x61, 0x3b, 0xb1, 0x34, 0x8b, 0xea, 0x4f, 0xfc, 0x1a, 0x1a, 0x6d, 0xd8, 0x6a, 0x0d,
0xe6, 0x7f, 0x38, 0xb4, 0x7a, 0x7c, 0x7c, 0xf0, 0xc0, 0x9a, 0xfe, 0x6a, 0x21, 0xbc, 0x3b, 0x7e,
0xec, 0xa1, 0x91, 0x00, 0x16, 0x55, 0x22, 0x76, 0xe0, 0x94, 0x85, 0x37, 0xa2, 0x1a, 0xa0, 0x15,
0x8e, 0xdf, 0x46, 0x77, 0x24, 0x88, 0x4d, 0x92, 0xc5, 0x46, 0xd3, 0x0e, 0xc6, 0x65, 0xe1, 0xdd,
0x79, 0x5c, 0x41, 0xb4, 0x89, 0xe1, 0x39, 0x1a, 0x2b, 0x10, 0x69, 0x92, 0x31, 0xa5, 0x53, 0x87,
0x26, 0xf5, 0xd5, 0xb2, 0xf0, 0xc6, 0x97, 0x1d, 0x4c, 0xfb, 0x39, 0xd3, 0x3f, 0x2c, 0x74, 0xb7,
0xe9, 0xe8, 0x82, 0x0b, 0x85, 0xdf, 0x40, 0x87, 0xe6, 0x37, 0x1b, 0x3f, 0x81, 0x5d, 0x16, 0xde,
0xa1, 0x99, 0x80, 0x41, 0xf1, 0x17, 0xc8, 0x36, 0x2b, 0x1b, 0xf2, 0x55, 0xe5, 0x2e, 0x38, 0xd5,
0x73, 0xba, 0xa8, 0xb1, 0x17, 0x85, 0xf7, 0xfa, 0xee, 0x39, 0x92, 0x26, 0x4c, 0x5b, 0xb2, 0x2e,
0x93, 0x73, 0xa1, 0x4c, 0x8f, 0xa3, 0xaa, 0x8c, 0x2e, 0x4f, 0x0d, 0xaa, 0x8d, 0xb0, 0x3c, 0x6f,
0x68, 0x66, 0x8f, 0x9c, 0xca, 0xc8, 0x79, 0x07, 0xd3, 0x7e, 0xce, 0xf4, 0xf9, 0x01, 0x3a, 0x6a,
0x8c, 0x3c, 0x5e, 0x25, 0x21, 0xe0, 0x9f, 0x90, 0xad, 0x2f, 0x3b, 0x62, 0x8a, 0x19, 0x37, 0xe3,
0xb3, 0xf7, 0x7b, 0x8b, 0xd3, 0x1e, 0x28, 0xc9, 0x97, 0xb1, 0x06, 0x24, 0xd1, 0xd9, 0xdd, 0x6e,
0x7e, 0x03, 0x8a, 0x75, 0x87, 0xd1, 0x61, 0xb4, 0x55, 0xc5, 0x9f, 0xa1, 0x71, 0x7d, 0x8a, 0x97,
0xdb, 0x1c, 0xea, 0x36, 0xa7, 0x35, 0x65, 0x7c, 0xde, 0x85, 0x5e, 0xdc, 0x7e, 0xd2, 0x3e, 0x0d,
0x7f, 0x8f, 0x1c, 0xa8, 0x1b, 0xd7, 0x27, 0xac, 0x37, 0xfc, 0x9d, 0x3d, 0x37, 0x3c, 0xb8, 0x5f,
0x17, 0x73, 0x1a, 0x44, 0xd2, 0x4e, 0x0c, 0x5f, 0xa0, 0x91, 0x1e, 0xa7, 0x9c, 0x0c, 0x8d, 0xea,
0xe9, 0x9e, 0xaa, 0xfa, 0x47, 0x04, 0x47, 0xb5, 0xf2, 0x48, 0xbf, 0x24, 0xad, 0x84, 0xa6, 0xbf,
0x5b, 0xe8, 0xfe, 0xad, 0x29, 0x7f, 0x9d, 0x48, 0x85, 0x7f, 0xdc, 0x99, 0x34, 0xd9, 0x6f, 0xd2,
0x9a, 0x6d, 0xe6, 0xdc, 0xde, 0x66, 0x83, 0xf4, 0xa6, 0xfc, 0x1d, 0x1a, 0x25, 0x0a, 0xd2, 0x66,
0x36, 0xef, 0xee, 0xe9, 0xc2, 0xb4, 0xd7, 0xd9, 0xf8, 0x4a, 0x4b, 0xd0, 0x4a, 0x29, 0x20, 0xd7,
0x37, 0xee, 0xe0, 0xe9, 0x8d, 0x3b, 0x78, 0x76, 0xe3, 0x0e, 0x7e, 0x29, 0x5d, 0xeb, 0xba, 0x74,
0xad, 0xa7, 0xa5, 0x6b, 0x3d, 0x2b, 0x5d, 0xeb, 0xcf, 0xd2, 0xb5, 0x7e, 0x7b, 0xee, 0x0e, 0x7e,
0xb0, 0x1b, 0xcd, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x03, 0x95, 0x92, 0xa5, 0xfa, 0x06, 0x00,
0x00,
var fileDescriptor_3a5d310fb1396ddf = []byte{
// 823 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6f, 0xe3, 0x44,
0x14, 0x8e, 0x9b, 0x86, 0xda, 0x93, 0xad, 0xd8, 0x1d, 0x21, 0x6d, 0x14, 0x90, 0x5d, 0x82, 0x16,
0x45, 0xaa, 0xb0, 0x69, 0x85, 0xd0, 0xc2, 0x89, 0x9a, 0xad, 0xf8, 0xbd, 0x54, 0xb3, 0x3d, 0xad,
0x90, 0x60, 0x6a, 0xbf, 0x75, 0x4d, 0xe2, 0x19, 0x6b, 0x66, 0x12, 0x29, 0x9c, 0xb8, 0x70, 0x86,
0xff, 0x83, 0xff, 0x81, 0x23, 0xea, 0x71, 0x6f, 0xec, 0xc9, 0xa2, 0xe6, 0xbf, 0xd8, 0x13, 0x9a,
0xb1, 0x1d, 0x7b, 0x49, 0xab, 0x70, 0xf3, 0x7c, 0xef, 0x7d, 0xdf, 0x7b, 0xef, 0x9b, 0x79, 0x46,
0x9f, 0xcc, 0x1e, 0x4a, 0x3f, 0xe5, 0xc1, 0x6c, 0x71, 0x01, 0x82, 0x81, 0x02, 0x19, 0x2c, 0x81,
0xc5, 0x5c, 0x04, 0x75, 0x80, 0xe6, 0x69, 0x10, 0xa7, 0x32, 0xe2, 0x4b, 0x10, 0xab, 0x60, 0x79,
0x14, 0x24, 0xc0, 0x40, 0x50, 0x05, 0xb1, 0x9f, 0x0b, 0xae, 0x38, 0xbe, 0x5f, 0x25, 0xfa, 0x34,
0x4f, 0xfd, 0x75, 0xa2, 0xbf, 0x3c, 0x1a, 0xbf, 0x97, 0xa4, 0xea, 0x72, 0x71, 0xe1, 0x47, 0x3c,
0x0b, 0x12, 0x9e, 0xf0, 0xc0, 0xe4, 0x5f, 0x2c, 0x9e, 0x99, 0x93, 0x39, 0x98, 0xaf, 0x4a, 0x67,
0x3c, 0xe9, 0x14, 0x8c, 0xb8, 0x80, 0x1b, 0x6a, 0x8d, 0x3f, 0x68, 0x73, 0x32, 0x1a, 0x5d, 0xa6,
0x4c, 0xf7, 0x94, 0xcf, 0x12, 0x0d, 0xc8, 0x20, 0x03, 0x45, 0x6f, 0x62, 0x05, 0xb7, 0xb1, 0xc4,
0x82, 0xa9, 0x34, 0x83, 0x0d, 0xc2, 0x87, 0xdb, 0x08, 0x32, 0xba, 0x84, 0x8c, 0xfe, 0x97, 0x37,
0xf9, 0x7d, 0x17, 0xd9, 0xa7, 0x2c, 0xce, 0x79, 0xca, 0x14, 0x3e, 0x44, 0x0e, 0x8d, 0x63, 0x01,
0x52, 0x82, 0x1c, 0x59, 0x07, 0xfd, 0xa9, 0x13, 0xee, 0x97, 0x85, 0xe7, 0x9c, 0x34, 0x20, 0x69,
0xe3, 0xf8, 0x7b, 0x84, 0x22, 0xce, 0xe2, 0x54, 0xa5, 0x9c, 0xc9, 0xd1, 0xce, 0x81, 0x35, 0x1d,
0x1e, 0x1f, 0xfa, 0xb7, 0x38, 0xeb, 0x37, 0x35, 0x3e, 0x5d, 0x53, 0x42, 0x7c, 0x55, 0x78, 0xbd,
0xb2, 0xf0, 0x50, 0x8b, 0x91, 0x8e, 0x24, 0x9e, 0x22, 0xfb, 0x92, 0x4b, 0xc5, 0x68, 0x06, 0xa3,
0xfe, 0x81, 0x35, 0x75, 0xc2, 0x3b, 0x65, 0xe1, 0xd9, 0x9f, 0xd7, 0x18, 0x59, 0x47, 0xf1, 0x19,
0x72, 0x14, 0x15, 0x09, 0x28, 0x02, 0xcf, 0x46, 0xbb, 0xa6, 0x93, 0x77, 0xba, 0x9d, 0xe8, 0xbb,
0xd1, 0x4d, 0x7c, 0x7b, 0xf1, 0x23, 0x44, 0x3a, 0x09, 0x04, 0xb0, 0x08, 0xaa, 0xe1, 0xce, 0x1b,
0x26, 0x69, 0x45, 0xf0, 0x2f, 0x16, 0xc2, 0x31, 0xe4, 0x02, 0x22, 0xed, 0xd5, 0x39, 0xcf, 0xf9,
0x9c, 0x27, 0xab, 0xd1, 0xe0, 0xa0, 0x3f, 0x1d, 0x1e, 0x7f, 0xb4, 0x75, 0x4a, 0xff, 0xd1, 0x06,
0xf7, 0x94, 0x29, 0xb1, 0x0a, 0xc7, 0xf5, 0xcc, 0x78, 0x33, 0x81, 0xdc, 0x50, 0x50, 0x7b, 0xc0,
0x78, 0x0c, 0x8f, 0xb5, 0x07, 0xaf, 0xb5, 0x1e, 0x3c, 0xae, 0x31, 0xb2, 0x8e, 0xe2, 0xb7, 0xd0,
0xee, 0x4f, 0x9c, 0xc1, 0x68, 0xcf, 0x64, 0xd9, 0x65, 0xe1, 0xed, 0x3e, 0xe5, 0x0c, 0x88, 0x41,
0xc7, 0xa7, 0xe8, 0xfe, 0x2d, 0x2d, 0xe1, 0xbb, 0xa8, 0x3f, 0x83, 0xd5, 0xc8, 0xd2, 0x3c, 0xa2,
0x3f, 0xf1, 0x1b, 0x68, 0xb0, 0xa4, 0xf3, 0x05, 0x98, 0x4b, 0x75, 0x48, 0x75, 0xf8, 0x78, 0xe7,
0xa1, 0x35, 0xf9, 0xd5, 0x42, 0x78, 0xf3, 0x26, 0xb1, 0x87, 0x06, 0x02, 0x68, 0x5c, 0x89, 0xd8,
0xa1, 0x53, 0x16, 0xde, 0x80, 0x68, 0x80, 0x54, 0x38, 0x7e, 0x80, 0xf6, 0x24, 0x88, 0x65, 0xca,
0x12, 0xa3, 0x69, 0x87, 0xc3, 0xb2, 0xf0, 0xf6, 0x9e, 0x54, 0x10, 0x69, 0x62, 0xf8, 0x08, 0x0d,
0x15, 0x88, 0x2c, 0x65, 0x54, 0xe9, 0xd4, 0xbe, 0x49, 0x7d, 0xbd, 0x2c, 0xbc, 0xe1, 0x79, 0x0b,
0x93, 0x6e, 0xce, 0xe4, 0x4f, 0x0b, 0xdd, 0x69, 0x3a, 0x3a, 0xe3, 0x42, 0x69, 0x1f, 0xcc, 0x8b,
0xb1, 0x5a, 0x1f, 0x8c, 0x53, 0x06, 0xc5, 0x9f, 0x21, 0xdb, 0xbc, 0xfb, 0x88, 0xcf, 0xab, 0xe9,
0xc2, 0x43, 0xed, 0xe7, 0x59, 0x8d, 0xbd, 0x2c, 0xbc, 0x37, 0x37, 0x77, 0xda, 0x6f, 0xc2, 0x64,
0x4d, 0xd6, 0x65, 0x72, 0x2e, 0x94, 0xe9, 0x71, 0x50, 0x95, 0xd1, 0xe5, 0x89, 0x41, 0xf5, 0x20,
0x34, 0xcf, 0x1b, 0x9a, 0x79, 0x92, 0x4e, 0x35, 0xc8, 0x49, 0x0b, 0x93, 0x6e, 0xce, 0xe4, 0xaf,
0x1d, 0xb4, 0xdf, 0x0c, 0xf2, 0x64, 0x9e, 0x46, 0x80, 0x7f, 0x40, 0xb6, 0xfe, 0x3d, 0xc4, 0x54,
0x51, 0x33, 0xcd, 0xf0, 0xf8, 0xfd, 0xce, 0xc3, 0x5b, 0x6f, 0xb9, 0x9f, 0xcf, 0x12, 0x0d, 0x48,
0x5f, 0x67, 0xb7, 0xcf, 0xfc, 0x1b, 0x50, 0xb4, 0xdd, 0xb1, 0x16, 0x23, 0x6b, 0x55, 0xfc, 0x08,
0x0d, 0xeb, 0x7d, 0x3e, 0x5f, 0xe5, 0x50, 0xb7, 0x39, 0xa9, 0x29, 0xc3, 0x93, 0x36, 0xf4, 0xf2,
0xd5, 0x23, 0xe9, 0xd2, 0x30, 0x41, 0x0e, 0xd4, 0x8d, 0xeb, 0xff, 0x80, 0xde, 0x90, 0xb7, 0xb7,
0x6e, 0x48, 0x78, 0xaf, 0x2e, 0xe3, 0x34, 0x88, 0x24, 0xad, 0x0c, 0xfe, 0x12, 0x0d, 0xb4, 0x91,
0x72, 0xd4, 0x37, 0x7a, 0x0f, 0xb6, 0xea, 0x69, 0xf3, 0xc3, 0xfd, 0x5a, 0x73, 0xa0, 0x4f, 0x92,
0x54, 0x12, 0x93, 0x3f, 0x2c, 0x74, 0xef, 0x15, 0x67, 0xbf, 0x4e, 0xa5, 0xc2, 0xdf, 0x6d, 0xb8,
0xeb, 0xff, 0x3f, 0x77, 0x35, 0xdb, 0x78, 0x7b, 0xb7, 0xae, 0x66, 0x37, 0x48, 0xc7, 0xd9, 0xaf,
0xd0, 0x20, 0x55, 0x90, 0x35, 0x7e, 0xbc, 0xbb, 0xb5, 0x7f, 0xd3, 0x58, 0x3b, 0xc0, 0x17, 0x9a,
0x4c, 0x2a, 0x8d, 0x70, 0x7a, 0x75, 0xed, 0xf6, 0x9e, 0x5f, 0xbb, 0xbd, 0x17, 0xd7, 0x6e, 0xef,
0xe7, 0xd2, 0xb5, 0xae, 0x4a, 0xd7, 0x7a, 0x5e, 0xba, 0xd6, 0x8b, 0xd2, 0xb5, 0xfe, 0x2e, 0x5d,
0xeb, 0xb7, 0x7f, 0xdc, 0xde, 0xd3, 0x9d, 0xe5, 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x34,
0x9c, 0x0c, 0xa4, 0x1b, 0x07, 0x00, 0x00,
}
func (m *Endpoint) Marshal() (dAtA []byte, err error) {
@ -274,6 +275,13 @@ func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.Zone != nil {
i -= len(*m.Zone)
copy(dAtA[i:], *m.Zone)
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Zone)))
i--
dAtA[i] = 0x3a
}
if m.NodeName != nil {
i -= len(*m.NodeName)
copy(dAtA[i:], *m.NodeName)
@ -281,23 +289,23 @@ func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x32
}
if len(m.Topology) > 0 {
keysForTopology := make([]string, 0, len(m.Topology))
for k := range m.Topology {
keysForTopology = append(keysForTopology, string(k))
if len(m.DeprecatedTopology) > 0 {
keysForDeprecatedTopology := make([]string, 0, len(m.DeprecatedTopology))
for k := range m.DeprecatedTopology {
keysForDeprecatedTopology = append(keysForDeprecatedTopology, string(k))
}
github_com_gogo_protobuf_sortkeys.Strings(keysForTopology)
for iNdEx := len(keysForTopology) - 1; iNdEx >= 0; iNdEx-- {
v := m.Topology[string(keysForTopology[iNdEx])]
github_com_gogo_protobuf_sortkeys.Strings(keysForDeprecatedTopology)
for iNdEx := len(keysForDeprecatedTopology) - 1; iNdEx >= 0; iNdEx-- {
v := m.DeprecatedTopology[string(keysForDeprecatedTopology[iNdEx])]
baseI := i
i -= len(v)
copy(dAtA[i:], v)
i = encodeVarintGenerated(dAtA, i, uint64(len(v)))
i--
dAtA[i] = 0x12
i -= len(keysForTopology[iNdEx])
copy(dAtA[i:], keysForTopology[iNdEx])
i = encodeVarintGenerated(dAtA, i, uint64(len(keysForTopology[iNdEx])))
i -= len(keysForDeprecatedTopology[iNdEx])
copy(dAtA[i:], keysForDeprecatedTopology[iNdEx])
i = encodeVarintGenerated(dAtA, i, uint64(len(keysForDeprecatedTopology[iNdEx])))
i--
dAtA[i] = 0xa
i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
@ -594,8 +602,8 @@ func (m *Endpoint) Size() (n int) {
l = m.TargetRef.Size()
n += 1 + l + sovGenerated(uint64(l))
}
if len(m.Topology) > 0 {
for k, v := range m.Topology {
if len(m.DeprecatedTopology) > 0 {
for k, v := range m.DeprecatedTopology {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
@ -606,6 +614,10 @@ func (m *Endpoint) Size() (n int) {
l = len(*m.NodeName)
n += 1 + l + sovGenerated(uint64(l))
}
if m.Zone != nil {
l = len(*m.Zone)
n += 1 + l + sovGenerated(uint64(l))
}
return n
}
@ -703,23 +715,24 @@ func (this *Endpoint) String() string {
if this == nil {
return "nil"
}
keysForTopology := make([]string, 0, len(this.Topology))
for k := range this.Topology {
keysForTopology = append(keysForTopology, k)
keysForDeprecatedTopology := make([]string, 0, len(this.DeprecatedTopology))
for k := range this.DeprecatedTopology {
keysForDeprecatedTopology = append(keysForDeprecatedTopology, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForTopology)
mapStringForTopology := "map[string]string{"
for _, k := range keysForTopology {
mapStringForTopology += fmt.Sprintf("%v: %v,", k, this.Topology[k])
github_com_gogo_protobuf_sortkeys.Strings(keysForDeprecatedTopology)
mapStringForDeprecatedTopology := "map[string]string{"
for _, k := range keysForDeprecatedTopology {
mapStringForDeprecatedTopology += fmt.Sprintf("%v: %v,", k, this.DeprecatedTopology[k])
}
mapStringForTopology += "}"
mapStringForDeprecatedTopology += "}"
s := strings.Join([]string{`&Endpoint{`,
`Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`,
`Conditions:` + strings.Replace(strings.Replace(this.Conditions.String(), "EndpointConditions", "EndpointConditions", 1), `&`, ``, 1) + `,`,
`Hostname:` + valueToStringGenerated(this.Hostname) + `,`,
`TargetRef:` + strings.Replace(fmt.Sprintf("%v", this.TargetRef), "ObjectReference", "v1.ObjectReference", 1) + `,`,
`Topology:` + mapStringForTopology + `,`,
`DeprecatedTopology:` + mapStringForDeprecatedTopology + `,`,
`NodeName:` + valueToStringGenerated(this.NodeName) + `,`,
`Zone:` + valueToStringGenerated(this.Zone) + `,`,
`}`,
}, "")
return s
@ -961,7 +974,7 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedTopology", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@ -988,8 +1001,8 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Topology == nil {
m.Topology = make(map[string]string)
if m.DeprecatedTopology == nil {
m.DeprecatedTopology = make(map[string]string)
}
var mapkey string
var mapvalue string
@ -1084,7 +1097,7 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error {
iNdEx += skippy
}
}
m.Topology[mapkey] = mapvalue
m.DeprecatedTopology[mapkey] = mapvalue
iNdEx = postIndex
case 6:
if wireType != 2 {
@ -1119,6 +1132,39 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error {
s := string(dAtA[iNdEx:postIndex])
m.NodeName = &s
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(dAtA[iNdEx:postIndex])
m.Zone = &s
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])

View File

@ -19,7 +19,7 @@ limitations under the License.
syntax = "proto2";
package k8s.io.api.discovery.v1alpha1;
package k8s.io.api.discovery.v1;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
@ -27,7 +27,7 @@ import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1alpha1";
option go_package = "v1";
// Endpoint represents a single logical "backend" implementing a service.
message Endpoint {
@ -45,8 +45,8 @@ message Endpoint {
// hostname of this endpoint. This field may be used by consumers of
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
// Multiple endpoints which use the same hostname should be considered
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass
// DNS label (RFC 1123) validation.
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS
// Label (RFC 1123) validation.
// +optional
optional string hostname = 3;
@ -55,27 +55,24 @@ message Endpoint {
// +optional
optional k8s.io.api.core.v1.ObjectReference targetRef = 4;
// topology contains arbitrary topology information associated with the
// endpoint. These key/value pairs must conform with the label format.
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
// Topology may include a maximum of 16 key/value pairs. This includes, but
// is not limited to the following well known keys:
// * kubernetes.io/hostname: the value indicates the hostname of the node
// where the endpoint is located. This should match the corresponding
// node label.
// * topology.kubernetes.io/zone: the value indicates the zone where the
// endpoint is located. This should match the corresponding node label.
// * topology.kubernetes.io/region: the value indicates the region where the
// endpoint is located. This should match the corresponding node label.
// This field is deprecated and will be removed in future api versions.
// deprecatedTopology contains topology information part of the v1beta1
// API. This field is deprecated, and will be removed when the v1beta1
// API is removed (no sooner than kubernetes v1.24). While this field can
// hold values, it is not writable through the v1 API, and any attempts to
// write to it will be silently ignored. Topology information can be found
// in the zone and nodeName fields instead.
// +optional
map<string, string> topology = 5;
map<string, string> deprecatedTopology = 5;
// nodeName represents the name of the Node hosting this endpoint. This can
// be used to determine endpoints local to a Node. This field can be enabled
// with the EndpointSliceNodeName feature gate.
// +optional
optional string nodeName = 6;
// zone is the name of the Zone this endpoint exists in.
// +optional
optional string zone = 7;
}
// EndpointConditions represents the current condition of an endpoint.
@ -130,8 +127,9 @@ message EndpointPort {
// This field follows standard Kubernetes label syntax.
// Un-prefixed names are reserved for IANA standard service names (as per
// RFC-6335 and http://www.iana.org/assignments/service-names).
// Non-standard protocols should use prefixed names.
// Default is empty string.
// Non-standard protocols should use prefixed names such as
// mycompany.com/my-custom-protocol.
// +optional
optional string appProtocol = 4;
}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -26,7 +26,7 @@ import (
const GroupName = "discovery.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
import (
v1 "k8s.io/api/core/v1"
@ -58,12 +58,6 @@ type EndpointSlice struct {
type AddressType string
const (
// AddressTypeIP represents an IP Address.
// This address type has been deprecated and has been replaced by the IPv4
// and IPv6 adddress types. New resources with this address type will be
// considered invalid. This will be fully removed in 1.18.
// +deprecated
AddressTypeIP = AddressType("IP")
// AddressTypeIPv4 represents an IPv4 Address.
AddressTypeIPv4 = AddressType(v1.IPv4Protocol)
// AddressTypeIPv6 represents an IPv6 Address.
@ -86,34 +80,32 @@ type Endpoint struct {
// hostname of this endpoint. This field may be used by consumers of
// endpoints to distinguish endpoints from each other (e.g. in DNS names).
// Multiple endpoints which use the same hostname should be considered
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass
// DNS label (RFC 1123) validation.
// fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS
// Label (RFC 1123) validation.
// +optional
Hostname *string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
// targetRef is a reference to a Kubernetes object that represents this
// endpoint.
// +optional
TargetRef *v1.ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,4,opt,name=targetRef"`
// topology contains arbitrary topology information associated with the
// endpoint. These key/value pairs must conform with the label format.
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
// Topology may include a maximum of 16 key/value pairs. This includes, but
// is not limited to the following well known keys:
// * kubernetes.io/hostname: the value indicates the hostname of the node
// where the endpoint is located. This should match the corresponding
// node label.
// * topology.kubernetes.io/zone: the value indicates the zone where the
// endpoint is located. This should match the corresponding node label.
// * topology.kubernetes.io/region: the value indicates the region where the
// endpoint is located. This should match the corresponding node label.
// This field is deprecated and will be removed in future api versions.
// deprecatedTopology contains topology information part of the v1beta1
// API. This field is deprecated, and will be removed when the v1beta1
// API is removed (no sooner than kubernetes v1.24). While this field can
// hold values, it is not writable through the v1 API, and any attempts to
// write to it will be silently ignored. Topology information can be found
// in the zone and nodeName fields instead.
// +optional
Topology map[string]string `json:"topology,omitempty" protobuf:"bytes,5,opt,name=topology"`
DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty" protobuf:"bytes,5,opt,name=deprecatedTopology"`
// nodeName represents the name of the Node hosting this endpoint. This can
// be used to determine endpoints local to a Node. This field can be enabled
// with the EndpointSliceNodeName feature gate.
// +optional
NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,6,opt,name=nodeName"`
// zone is the name of the Zone this endpoint exists in.
// +optional
Zone *string `json:"zone,omitempty" protobuf:"bytes,7,opt,name=zone"`
}
// EndpointConditions represents the current condition of an endpoint.
@ -165,8 +157,9 @@ type EndpointPort struct {
// This field follows standard Kubernetes label syntax.
// Un-prefixed names are reserved for IANA standard service names (as per
// RFC-6335 and http://www.iana.org/assignments/service-names).
// Non-standard protocols should use prefixed names.
// Default is empty string.
// Non-standard protocols should use prefixed names such as
// mycompany.com/my-custom-protocol.
// +optional
AppProtocol *string `json:"appProtocol,omitempty" protobuf:"bytes,4,name=appProtocol"`
}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
// This file contains a collection of methods that can be used from go-restful to
// generate Swagger API documentation for its models. Please read this PR for more
@ -28,13 +28,14 @@ package v1alpha1
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
var map_Endpoint = map[string]string{
"": "Endpoint represents a single logical \"backend\" implementing a service.",
"addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.",
"conditions": "conditions contains information about the current status of the endpoint.",
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS label (RFC 1123) validation.",
"targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.",
"topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.\nThis field is deprecated and will be removed in future api versions.",
"nodeName": "nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. This field can be enabled with the EndpointSliceNodeName feature gate.",
"": "Endpoint represents a single logical \"backend\" implementing a service.",
"addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.",
"conditions": "conditions contains information about the current status of the endpoint.",
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.",
"targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.",
"deprecatedTopology": "deprecatedTopology contains topology information part of the v1beta1 API. This field is deprecated, and will be removed when the v1beta1 API is removed (no sooner than kubernetes v1.24). While this field can hold values, it is not writable through the v1 API, and any attempts to write to it will be silently ignored. Topology information can be found in the zone and nodeName fields instead.",
"nodeName": "nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. This field can be enabled with the EndpointSliceNodeName feature gate.",
"zone": "zone is the name of the Zone this endpoint exists in.",
}
func (Endpoint) SwaggerDoc() map[string]string {
@ -57,7 +58,7 @@ var map_EndpointPort = map[string]string{
"name": "The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.",
"protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.",
"port": "The port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.",
"appProtocol": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names. Default is empty string.",
"appProtocol": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.",
}
func (EndpointPort) SwaggerDoc() map[string]string {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1
const (
// LabelServiceName is used to indicate the name of a Kubernetes service.
@ -25,4 +25,8 @@ const (
// same cluster. It is highly recommended to configure this label for all
// EndpointSlices.
LabelManagedBy = "endpointslice.kubernetes.io/managed-by"
// LabelSkipMirror can be set to true on an Endpoints resource to indicate
// that the EndpointSliceMirroring controller should not mirror this
// resource with EndpointSlices.
LabelSkipMirror = "endpointslice.kubernetes.io/skip-mirror"
)

View File

@ -18,10 +18,10 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@ -41,11 +41,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) {
}
if in.TargetRef != nil {
in, out := &in.TargetRef, &out.TargetRef
*out = new(v1.ObjectReference)
*out = new(corev1.ObjectReference)
**out = **in
}
if in.Topology != nil {
in, out := &in.Topology, &out.Topology
if in.DeprecatedTopology != nil {
in, out := &in.DeprecatedTopology, &out.DeprecatedTopology
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
@ -56,6 +56,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) {
*out = new(string)
**out = **in
}
if in.Zone != nil {
in, out := &in.Zone, &out.Zone
*out = new(string)
**out = **in
}
return
}
@ -110,7 +115,7 @@ func (in *EndpointPort) DeepCopyInto(out *EndpointPort) {
}
if in.Protocol != nil {
in, out := &in.Protocol, &out.Protocol
*out = new(v1.Protocol)
*out = new(corev1.Protocol)
**out = **in
}
if in.Port != nil {

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.

View File

@ -152,7 +152,7 @@ func TestServerSidePrint(t *testing.T) {
s, _, closeFn := setupWithResources(t,
// additional groupversions needed for the test to run
[]schema.GroupVersion{
{Group: "discovery.k8s.io", Version: "v1alpha1"},
{Group: "discovery.k8s.io", Version: "v1"},
{Group: "discovery.k8s.io", Version: "v1beta1"},
{Group: "rbac.authorization.k8s.io", Version: "v1alpha1"},
{Group: "scheduling.k8s.io", Version: "v1"},

View File

@ -198,6 +198,14 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
},
// --
// k8s.io/kubernetes/pkg/apis/discovery/v1
gvr("discovery.k8s.io", "v1", "endpointslices"): {
Stub: `{"metadata": {"name": "slicev1"}, "addressType": "IPv4", "protocol": "TCP", "ports": [], "endpoints": []}`,
ExpectedEtcdPath: "/registry/endpointslices/" + namespace + "/slicev1",
ExpectedGVK: gvkP("discovery.k8s.io", "v1beta1", "EndpointSlice"),
},
// --
// k8s.io/kubernetes/pkg/apis/discovery/v1beta1
gvr("discovery.k8s.io", "v1beta1", "endpointslices"): {
Stub: `{"metadata": {"name": "slicev1beta1"}, "addressType": "IPv4", "protocol": "TCP", "ports": [], "endpoints": []}`,

12
vendor/modules.txt vendored
View File

@ -1568,7 +1568,7 @@ k8s.io/api/certificates/v1beta1
k8s.io/api/coordination/v1
k8s.io/api/coordination/v1beta1
k8s.io/api/core/v1
k8s.io/api/discovery/v1alpha1
k8s.io/api/discovery/v1
k8s.io/api/discovery/v1beta1
k8s.io/api/events/v1
k8s.io/api/events/v1beta1
@ -1892,7 +1892,7 @@ k8s.io/client-go/applyconfigurations/certificates/v1beta1
k8s.io/client-go/applyconfigurations/coordination/v1
k8s.io/client-go/applyconfigurations/coordination/v1beta1
k8s.io/client-go/applyconfigurations/core/v1
k8s.io/client-go/applyconfigurations/discovery/v1alpha1
k8s.io/client-go/applyconfigurations/discovery/v1
k8s.io/client-go/applyconfigurations/discovery/v1beta1
k8s.io/client-go/applyconfigurations/events/v1
k8s.io/client-go/applyconfigurations/events/v1beta1
@ -1949,7 +1949,7 @@ k8s.io/client-go/informers/coordination/v1beta1
k8s.io/client-go/informers/core
k8s.io/client-go/informers/core/v1
k8s.io/client-go/informers/discovery
k8s.io/client-go/informers/discovery/v1alpha1
k8s.io/client-go/informers/discovery/v1
k8s.io/client-go/informers/discovery/v1beta1
k8s.io/client-go/informers/events
k8s.io/client-go/informers/events/v1
@ -2024,8 +2024,8 @@ k8s.io/client-go/kubernetes/typed/coordination/v1beta1
k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake
k8s.io/client-go/kubernetes/typed/core/v1
k8s.io/client-go/kubernetes/typed/core/v1/fake
k8s.io/client-go/kubernetes/typed/discovery/v1alpha1
k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake
k8s.io/client-go/kubernetes/typed/discovery/v1
k8s.io/client-go/kubernetes/typed/discovery/v1/fake
k8s.io/client-go/kubernetes/typed/discovery/v1beta1
k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake
k8s.io/client-go/kubernetes/typed/events/v1
@ -2084,7 +2084,7 @@ k8s.io/client-go/listers/certificates/v1beta1
k8s.io/client-go/listers/coordination/v1
k8s.io/client-go/listers/coordination/v1beta1
k8s.io/client-go/listers/core/v1
k8s.io/client-go/listers/discovery/v1alpha1
k8s.io/client-go/listers/discovery/v1
k8s.io/client-go/listers/discovery/v1beta1
k8s.io/client-go/listers/events/v1
k8s.io/client-go/listers/events/v1beta1