@@ -8,6 +8,32 @@ import (
8
8
)
9
9
10
10
func registerGatewayApiConverters (scheme * runtime.Scheme ) {
11
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.GatewayClassList {}, & gwapiv1beta1.GatewayClassList {},
12
+ func (a , b interface {}, scope conversion.Scope ) error {
13
+ lb := b .(* gwapiv1beta1.GatewayClassList )
14
+ la := a .(* gwapiv1alpha2.GatewayClassList )
15
+ lb .Items = make ([]gwapiv1beta1.GatewayClass , len (la .Items ))
16
+ for i := range la .Items {
17
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
18
+ return err
19
+ }
20
+ }
21
+ setApiVersion (b , gwapiv1beta1 .GroupVersion )
22
+ return nil
23
+ })
24
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1beta1.GatewayClassList {}, & gwapiv1alpha2.GatewayClassList {},
25
+ func (a , b interface {}, scope conversion.Scope ) error {
26
+ lb := b .(* gwapiv1alpha2.GatewayClassList )
27
+ la := a .(* gwapiv1beta1.GatewayClassList )
28
+ lb .Items = make ([]gwapiv1alpha2.GatewayClass , len (la .Items ))
29
+ for i := range la .Items {
30
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
31
+ return err
32
+ }
33
+ }
34
+ setApiVersion (b , gwapiv1alpha2 .GroupVersion )
35
+ return nil
36
+ })
11
37
_ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.GatewayClass {}, & gwapiv1beta1.GatewayClass {},
12
38
func (a , b interface {}, scope conversion.Scope ) error {
13
39
* (b .(* gwapiv1beta1.GatewayClass )) = gwapiv1beta1 .GatewayClass (* a .(* gwapiv1alpha2.GatewayClass ))
@@ -21,6 +47,32 @@ func registerGatewayApiConverters(scheme *runtime.Scheme) {
21
47
return nil
22
48
})
23
49
50
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.GatewayList {}, & gwapiv1beta1.GatewayList {},
51
+ func (a , b interface {}, scope conversion.Scope ) error {
52
+ lb := b .(* gwapiv1beta1.GatewayList )
53
+ la := a .(* gwapiv1alpha2.GatewayList )
54
+ lb .Items = make ([]gwapiv1beta1.Gateway , len (la .Items ))
55
+ for i := range la .Items {
56
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
57
+ return err
58
+ }
59
+ }
60
+ setApiVersion (b , gwapiv1beta1 .GroupVersion )
61
+ return nil
62
+ })
63
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1beta1.GatewayList {}, & gwapiv1alpha2.GatewayList {},
64
+ func (a , b interface {}, scope conversion.Scope ) error {
65
+ lb := b .(* gwapiv1alpha2.GatewayList )
66
+ la := a .(* gwapiv1beta1.GatewayList )
67
+ lb .Items = make ([]gwapiv1alpha2.Gateway , len (la .Items ))
68
+ for i := range la .Items {
69
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
70
+ return err
71
+ }
72
+ }
73
+ setApiVersion (b , gwapiv1alpha2 .GroupVersion )
74
+ return nil
75
+ })
24
76
_ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.Gateway {}, & gwapiv1beta1.Gateway {},
25
77
func (a , b interface {}, scope conversion.Scope ) error {
26
78
* (b .(* gwapiv1beta1.Gateway )) = gwapiv1beta1 .Gateway (* a .(* gwapiv1alpha2.Gateway ))
@@ -34,6 +86,32 @@ func registerGatewayApiConverters(scheme *runtime.Scheme) {
34
86
return nil
35
87
})
36
88
89
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.HTTPRouteList {}, & gwapiv1beta1.HTTPRouteList {},
90
+ func (a , b interface {}, scope conversion.Scope ) error {
91
+ lb := b .(* gwapiv1beta1.HTTPRouteList )
92
+ la := a .(* gwapiv1alpha2.HTTPRouteList )
93
+ lb .Items = make ([]gwapiv1beta1.HTTPRoute , len (la .Items ))
94
+ for i := range la .Items {
95
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
96
+ return err
97
+ }
98
+ }
99
+ setApiVersion (b , gwapiv1beta1 .GroupVersion )
100
+ return nil
101
+ })
102
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1beta1.HTTPRouteList {}, & gwapiv1alpha2.HTTPRouteList {},
103
+ func (a , b interface {}, scope conversion.Scope ) error {
104
+ lb := b .(* gwapiv1alpha2.HTTPRouteList )
105
+ la := a .(* gwapiv1beta1.HTTPRouteList )
106
+ lb .Items = make ([]gwapiv1alpha2.HTTPRoute , len (la .Items ))
107
+ for i := range la .Items {
108
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
109
+ return err
110
+ }
111
+ }
112
+ setApiVersion (b , gwapiv1alpha2 .GroupVersion )
113
+ return nil
114
+ })
37
115
_ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.HTTPRoute {}, & gwapiv1beta1.HTTPRoute {},
38
116
func (a , b interface {}, scope conversion.Scope ) error {
39
117
* (b .(* gwapiv1beta1.HTTPRoute )) = gwapiv1beta1 .HTTPRoute (* a .(* gwapiv1alpha2.HTTPRoute ))
@@ -47,6 +125,32 @@ func registerGatewayApiConverters(scheme *runtime.Scheme) {
47
125
return nil
48
126
})
49
127
128
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.ReferenceGrantList {}, & gwapiv1beta1.ReferenceGrantList {},
129
+ func (a , b interface {}, scope conversion.Scope ) error {
130
+ lb := b .(* gwapiv1beta1.ReferenceGrantList )
131
+ la := a .(* gwapiv1alpha2.ReferenceGrantList )
132
+ lb .Items = make ([]gwapiv1beta1.ReferenceGrant , len (la .Items ))
133
+ for i := range la .Items {
134
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
135
+ return err
136
+ }
137
+ }
138
+ setApiVersion (b , gwapiv1beta1 .GroupVersion )
139
+ return nil
140
+ })
141
+ _ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1beta1.ReferenceGrantList {}, & gwapiv1alpha2.ReferenceGrantList {},
142
+ func (a , b interface {}, scope conversion.Scope ) error {
143
+ lb := b .(* gwapiv1alpha2.ReferenceGrantList )
144
+ la := a .(* gwapiv1beta1.ReferenceGrantList )
145
+ lb .Items = make ([]gwapiv1alpha2.ReferenceGrant , len (la .Items ))
146
+ for i := range la .Items {
147
+ if err := scheme .Convert (& la .Items [i ], & lb .Items [i ], scope ); err != nil {
148
+ return err
149
+ }
150
+ }
151
+ setApiVersion (b , gwapiv1alpha2 .GroupVersion )
152
+ return nil
153
+ })
50
154
_ = scheme .Converter ().RegisterUntypedConversionFunc (& gwapiv1alpha2.ReferenceGrant {}, & gwapiv1beta1.ReferenceGrant {},
51
155
func (a , b interface {}, scope conversion.Scope ) error {
52
156
* (b .(* gwapiv1beta1.ReferenceGrant )) = gwapiv1beta1 .ReferenceGrant (* a .(* gwapiv1alpha2.ReferenceGrant ))
0 commit comments