mirror of https://github.com/k3s-io/k3s
Merge pull request #43085 from sttts/sttts-duplicated-meta-conversions
Automatic merge from submit-queue apimachinery/pkg/apis/meta: remove duplicated conversionspull/6/head
commit
5ba21e83b9
|
@ -20,16 +20,14 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/conversion"
|
"k8s.io/apimachinery/pkg/conversion"
|
||||||
"k8s.io/apimachinery/pkg/fields"
|
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
|
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
|
||||||
if err := Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
if err := metav1.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
if err := metav1.Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
out.ResourceVersion = in.ResourceVersion
|
out.ResourceVersion = in.ResourceVersion
|
||||||
|
@ -39,10 +37,10 @@ func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOptions, out *ListOptions, s conversion.Scope) error {
|
||||||
if err := Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
if err := metav1.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
if err := metav1.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
out.ResourceVersion = in.ResourceVersion
|
out.ResourceVersion = in.ResourceVersion
|
||||||
|
@ -51,40 +49,6 @@ func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOption
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_string_To_labels_Selector(in *string, out *labels.Selector, s conversion.Scope) error {
|
|
||||||
selector, err := labels.Parse(*in)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*out = selector
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_string_To_fields_Selector(in *string, out *fields.Selector, s conversion.Scope) error {
|
|
||||||
selector, err := fields.ParseSelector(*in)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*out = selector
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_labels_Selector_To_string(in *labels.Selector, out *string, s conversion.Scope) error {
|
|
||||||
if *in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
*out = (*in).String()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_fields_Selector_To_string(in *fields.Selector, out *string, s conversion.Scope) error {
|
|
||||||
if *in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
*out = (*in).String()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_map_to_v1_LabelSelector(in *map[string]string, out *metav1.LabelSelector, s conversion.Scope) error {
|
func Convert_map_to_v1_LabelSelector(in *map[string]string, out *metav1.LabelSelector, s conversion.Scope) error {
|
||||||
if in == nil {
|
if in == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -49,11 +49,11 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
scheme.AddConversionFuncs(
|
scheme.AddConversionFuncs(
|
||||||
Convert_string_To_labels_Selector,
|
metav1.Convert_string_To_labels_Selector,
|
||||||
Convert_labels_Selector_To_string,
|
metav1.Convert_labels_Selector_To_string,
|
||||||
|
|
||||||
Convert_string_To_fields_Selector,
|
metav1.Convert_string_To_fields_Selector,
|
||||||
Convert_fields_Selector_To_string,
|
metav1.Convert_fields_Selector_To_string,
|
||||||
|
|
||||||
Convert_map_to_v1_LabelSelector,
|
Convert_map_to_v1_LabelSelector,
|
||||||
Convert_v1_LabelSelector_to_map,
|
Convert_v1_LabelSelector_to_map,
|
||||||
|
|
Loading…
Reference in New Issue