@@ -80,13 +80,32 @@ var _ ctrlconversion.Convertible = &OpenStackClusterTemplate{}
80
80
func (r * OpenStackClusterTemplate ) ConvertTo (dstRaw ctrlconversion.Hub ) error {
81
81
dst := dstRaw .(* infrav1.OpenStackClusterTemplate )
82
82
83
- return Convert_v1alpha4_OpenStackClusterTemplate_To_v1alpha6_OpenStackClusterTemplate (r , dst , nil )
83
+ if err := Convert_v1alpha4_OpenStackClusterTemplate_To_v1alpha6_OpenStackClusterTemplate (r , dst , nil ); err != nil {
84
+ return err
85
+ }
86
+
87
+ // Manually restore data.
88
+ restored := & infrav1.OpenStackClusterTemplate {}
89
+ if ok , err := utilconversion .UnmarshalData (r , restored ); err != nil || ! ok {
90
+ return err
91
+ }
92
+
93
+ return nil
84
94
}
85
95
86
96
func (r * OpenStackClusterTemplate ) ConvertFrom (srcRaw ctrlconversion.Hub ) error {
87
97
src := srcRaw .(* infrav1.OpenStackClusterTemplate )
88
98
89
- return Convert_v1alpha6_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate (src , r , nil )
99
+ if err := Convert_v1alpha6_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate (src , r , nil ); err != nil {
100
+ return err
101
+ }
102
+
103
+ // Preserve Hub data on down-conversion except for metadata
104
+ if err := utilconversion .MarshalData (src , r ); err != nil {
105
+ return err
106
+ }
107
+
108
+ return nil
90
109
}
91
110
92
111
var _ ctrlconversion.Convertible = & OpenStackClusterTemplateList {}
@@ -108,7 +127,17 @@ var _ ctrlconversion.Convertible = &OpenStackMachine{}
108
127
func (r * OpenStackMachine ) ConvertTo (dstRaw ctrlconversion.Hub ) error {
109
128
dst := dstRaw .(* infrav1.OpenStackMachine )
110
129
111
- return Convert_v1alpha4_OpenStackMachine_To_v1alpha6_OpenStackMachine (r , dst , nil )
130
+ if err := Convert_v1alpha4_OpenStackMachine_To_v1alpha6_OpenStackMachine (r , dst , nil ); err != nil {
131
+ return err
132
+ }
133
+
134
+ // Manually restore data.
135
+ restored := & infrav1.OpenStackMachine {}
136
+ if ok , err := utilconversion .UnmarshalData (r , restored ); err != nil || ! ok {
137
+ return err
138
+ }
139
+
140
+ return nil
112
141
}
113
142
114
143
func (r * OpenStackMachine ) ConvertFrom (srcRaw ctrlconversion.Hub ) error {
@@ -145,7 +174,17 @@ var _ ctrlconversion.Convertible = &OpenStackMachineTemplate{}
145
174
func (r * OpenStackMachineTemplate ) ConvertTo (dstRaw ctrlconversion.Hub ) error {
146
175
dst := dstRaw .(* infrav1.OpenStackMachineTemplate )
147
176
148
- return Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha6_OpenStackMachineTemplate (r , dst , nil )
177
+ if err := Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha6_OpenStackMachineTemplate (r , dst , nil ); err != nil {
178
+ return err
179
+ }
180
+
181
+ // Manually restore data.
182
+ restored := & infrav1.OpenStackMachineTemplate {}
183
+ if ok , err := utilconversion .UnmarshalData (r , restored ); err != nil || ! ok {
184
+ return err
185
+ }
186
+
187
+ return nil
149
188
}
150
189
151
190
func (r * OpenStackMachineTemplate ) ConvertFrom (srcRaw ctrlconversion.Hub ) error {
0 commit comments