|
| 1 | +/* |
| 2 | +
|
| 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 v1alpha3 |
| 18 | + |
| 19 | +import ( |
| 20 | + apiconversion "k8s.io/apimachinery/pkg/conversion" |
| 21 | + "sigs.k8s.io/controller-runtime/pkg/conversion" |
| 22 | + "unsafe" |
| 23 | + |
| 24 | + "github.com/spectrocloud/cluster-api-provider-maas/api/v1alpha4" |
| 25 | +) |
| 26 | + |
| 27 | +func (in *MaasCluster) ConvertTo(dstRaw conversion.Hub) error { |
| 28 | + dst := dstRaw.(*v1alpha4.MaasCluster) |
| 29 | + |
| 30 | + return Convert_v1alpha3_MaasCluster_To_v1alpha4_MaasCluster(in, dst, nil) |
| 31 | +} |
| 32 | + |
| 33 | +func (in *MaasCluster) ConvertFrom(srcRaw conversion.Hub) error { |
| 34 | + src := srcRaw.(*v1alpha4.MaasCluster) |
| 35 | + |
| 36 | + return Convert_v1alpha4_MaasCluster_To_v1alpha3_MaasCluster(src, in, nil) |
| 37 | +} |
| 38 | + |
| 39 | +func (in *MaasClusterList) ConvertTo(dstRaw conversion.Hub) error { |
| 40 | + dst := dstRaw.(*v1alpha4.MaasClusterList) |
| 41 | + |
| 42 | + return Convert_v1alpha3_MaasClusterList_To_v1alpha4_MaasClusterList(in, dst, nil) |
| 43 | +} |
| 44 | + |
| 45 | +func (in *MaasClusterList) ConvertFrom(srcRaw conversion.Hub) error { |
| 46 | + src := srcRaw.(*v1alpha4.MaasClusterList) |
| 47 | + |
| 48 | + return Convert_v1alpha4_MaasClusterList_To_v1alpha3_MaasClusterList(src, in, nil) |
| 49 | +} |
| 50 | + |
| 51 | +func (in *MaasMachine) ConvertTo(dstRaw conversion.Hub) error { |
| 52 | + dst := dstRaw.(*v1alpha4.MaasMachine) |
| 53 | + |
| 54 | + return Convert_v1alpha3_MaasMachine_To_v1alpha4_MaasMachine(in, dst, nil) |
| 55 | +} |
| 56 | + |
| 57 | +func (in *MaasMachine) ConvertFrom(srcRaw conversion.Hub) error { |
| 58 | + src := srcRaw.(*v1alpha4.MaasMachine) |
| 59 | + |
| 60 | + return Convert_v1alpha4_MaasMachine_To_v1alpha3_MaasMachine(src, in, nil) |
| 61 | +} |
| 62 | + |
| 63 | +func (in *MaasMachineList) ConvertTo(dstRaw conversion.Hub) error { |
| 64 | + dst := dstRaw.(*v1alpha4.MaasMachineList) |
| 65 | + |
| 66 | + return Convert_v1alpha3_MaasMachineList_To_v1alpha4_MaasMachineList(in, dst, nil) |
| 67 | +} |
| 68 | + |
| 69 | +func (in *MaasMachineList) ConvertFrom(srcRaw conversion.Hub) error { |
| 70 | + src := srcRaw.(*v1alpha4.MaasMachineList) |
| 71 | + |
| 72 | + return Convert_v1alpha4_MaasMachineList_To_v1alpha3_MaasMachineList(src, in, nil) |
| 73 | +} |
| 74 | + |
| 75 | +func (in *MaasMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { |
| 76 | + dst := dstRaw.(*v1alpha4.MaasMachineTemplate) |
| 77 | + |
| 78 | + return Convert_v1alpha3_MaasMachineTemplate_To_v1alpha4_MaasMachineTemplate(in, dst, nil) |
| 79 | +} |
| 80 | + |
| 81 | +func (in *MaasMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { |
| 82 | + src := srcRaw.(*v1alpha4.MaasMachineTemplate) |
| 83 | + |
| 84 | + return Convert_v1alpha4_MaasMachineTemplate_To_v1alpha3_MaasMachineTemplate(src, in, nil) |
| 85 | +} |
| 86 | + |
| 87 | +func (in *MaasMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { |
| 88 | + dst := dstRaw.(*v1alpha4.MaasMachineTemplateList) |
| 89 | + |
| 90 | + return Convert_v1alpha3_MaasMachineTemplateList_To_v1alpha4_MaasMachineTemplateList(in, dst, nil) |
| 91 | +} |
| 92 | + |
| 93 | +func (in *MaasMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { |
| 94 | + src := srcRaw.(*v1alpha4.MaasMachineTemplateList) |
| 95 | + |
| 96 | + return Convert_v1alpha4_MaasMachineTemplateList_To_v1alpha3_MaasMachineTemplateList(src, in, nil) |
| 97 | +} |
| 98 | + |
| 99 | +func Convert_v1alpha4_MaasMachineSpec_To_v1alpha3_MaasMachineSpec(in *v1alpha4.MaasMachineSpec, out *MaasMachineSpec, s apiconversion.Scope) error { |
| 100 | + if err := autoConvert_v1alpha4_MaasMachineSpec_To_v1alpha3_MaasMachineSpec(in, out, s); err != nil { |
| 101 | + return err |
| 102 | + } |
| 103 | + out.MinMemory = (*int)(unsafe.Pointer(in.MinMemoryInMB)) |
| 104 | + return nil |
| 105 | +} |
| 106 | + |
| 107 | +func Convert_v1alpha3_MaasMachineSpec_To_v1alpha4_MaasMachineSpec(in *MaasMachineSpec, out *v1alpha4.MaasMachineSpec, s apiconversion.Scope) error { |
| 108 | + if err := autoConvert_v1alpha3_MaasMachineSpec_To_v1alpha4_MaasMachineSpec(in, out, s); err != nil { |
| 109 | + return err |
| 110 | + } |
| 111 | + out.MinMemoryInMB = (*int)(unsafe.Pointer(in.MinMemory)) |
| 112 | + return nil |
| 113 | +} |
0 commit comments