Code refactoring for bpa operator
[icn.git] / cmd / bpa-operator / vendor / k8s.io / apimachinery / pkg / apis / meta / internalversion / conversion.go
1 /*
2 Copyright 2017 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package internalversion
18
19 import (
20         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21         "k8s.io/apimachinery/pkg/conversion"
22 )
23
24 func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
25         if err := metav1.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil {
26                 return err
27         }
28         if err := metav1.Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil {
29                 return err
30         }
31         out.IncludeUninitialized = in.IncludeUninitialized
32         out.ResourceVersion = in.ResourceVersion
33         out.TimeoutSeconds = in.TimeoutSeconds
34         out.Watch = in.Watch
35         out.Limit = in.Limit
36         out.Continue = in.Continue
37         return nil
38 }
39
40 func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOptions, out *ListOptions, s conversion.Scope) error {
41         if err := metav1.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil {
42                 return err
43         }
44         if err := metav1.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
45                 return err
46         }
47         out.IncludeUninitialized = in.IncludeUninitialized
48         out.ResourceVersion = in.ResourceVersion
49         out.TimeoutSeconds = in.TimeoutSeconds
50         out.Watch = in.Watch
51         out.Limit = in.Limit
52         out.Continue = in.Continue
53         return nil
54 }