mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #80157 from wojtek-t/remove_static_conversions
Remove manual conversions for ListOptions
This commit is contained in:
commit
635b83c5f4
@ -24,7 +24,6 @@ go_test(
|
|||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = [
|
srcs = [
|
||||||
"conversion.go",
|
|
||||||
"doc.go",
|
"doc.go",
|
||||||
"register.go",
|
"register.go",
|
||||||
"types.go",
|
"types.go",
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2017 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 internalversion
|
|
||||||
|
|
||||||
import (
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/apimachinery/pkg/conversion"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
|
|
||||||
if err := metav1.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := metav1.Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.ResourceVersion = in.ResourceVersion
|
|
||||||
out.TimeoutSeconds = in.TimeoutSeconds
|
|
||||||
out.Watch = in.Watch
|
|
||||||
out.Limit = in.Limit
|
|
||||||
out.Continue = in.Continue
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
|
||||||
if err := metav1.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := metav1.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.ResourceVersion = in.ResourceVersion
|
|
||||||
out.TimeoutSeconds = in.TimeoutSeconds
|
|
||||||
out.Watch = in.Watch
|
|
||||||
out.Limit = in.Limit
|
|
||||||
out.Continue = in.Continue
|
|
||||||
return nil
|
|
||||||
}
|
|
@ -66,9 +66,6 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
|
|
||||||
metav1.Convert_Map_string_To_string_To_v1_LabelSelector,
|
metav1.Convert_Map_string_To_string_To_v1_LabelSelector,
|
||||||
metav1.Convert_v1_LabelSelector_To_Map_string_To_string,
|
metav1.Convert_v1_LabelSelector_To_Map_string_To_string,
|
||||||
|
|
||||||
Convert_internalversion_ListOptions_To_v1_ListOptions,
|
|
||||||
Convert_v1_ListOptions_To_internalversion_ListOptions,
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -55,16 +55,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := s.AddConversionFunc((*ListOptions)(nil), (*v1.ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
|
||||||
return Convert_internalversion_ListOptions_To_v1_ListOptions(a.(*ListOptions), b.(*v1.ListOptions), scope)
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := s.AddConversionFunc((*v1.ListOptions)(nil), (*ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
|
||||||
return Convert_v1_ListOptions_To_internalversion_ListOptions(a.(*v1.ListOptions), b.(*ListOptions), scope)
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +116,11 @@ func autoConvert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert_internalversion_ListOptions_To_v1_ListOptions is an autogenerated conversion function.
|
||||||
|
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *v1.ListOptions, s conversion.Scope) error {
|
||||||
|
return autoConvert_internalversion_ListOptions_To_v1_ListOptions(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
func autoConvert_v1_ListOptions_To_internalversion_ListOptions(in *v1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
func autoConvert_v1_ListOptions_To_internalversion_ListOptions(in *v1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
||||||
if err := v1.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
if err := v1.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -141,3 +136,8 @@ func autoConvert_v1_ListOptions_To_internalversion_ListOptions(in *v1.ListOption
|
|||||||
out.Continue = in.Continue
|
out.Continue = in.Continue
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert_v1_ListOptions_To_internalversion_ListOptions is an autogenerated conversion function.
|
||||||
|
func Convert_v1_ListOptions_To_internalversion_ListOptions(in *v1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_ListOptions_To_internalversion_ListOptions(in, out, s)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user