sigs.k8s.io/cluster-api-provider-aws@v1.5.5/api/v1alpha4/awsidentity_conversion.go (about) 1 /* 2 Copyright 2021 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 v1alpha4 18 19 import ( 20 infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" 21 "sigs.k8s.io/controller-runtime/pkg/conversion" 22 ) 23 24 // ConvertTo converts the v1alpha4 AWSClusterControllerIdentity receiver to a v1beta1 AWSClusterControllerIdentity. 25 func (src *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { 26 dst := dstRaw.(*infrav1.AWSClusterControllerIdentity) 27 return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(src, dst, nil) 28 } 29 30 // ConvertFrom converts the v1beta1 AWSClusterControllerIdentity to a v1alpha4 AWSClusterControllerIdentity. 31 func (dst *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error { 32 src := srcRaw.(*infrav1.AWSClusterControllerIdentity) 33 34 return Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(src, dst, nil) 35 } 36 37 // ConvertTo converts the v1alpha4 AWSClusterControllerIdentityList receiver to a v1beta1 AWSClusterControllerIdentityList. 38 func (src *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { 39 dst := dstRaw.(*infrav1.AWSClusterControllerIdentityList) 40 return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(src, dst, nil) 41 } 42 43 // ConvertFrom converts the v1beta1 AWSClusterControllerIdentityList to a v1alpha4 AWSClusterControllerIdentityList. 44 func (dst *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error { 45 src := srcRaw.(*infrav1.AWSClusterControllerIdentityList) 46 47 return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(src, dst, nil) 48 } 49 50 // ConvertTo converts the v1alpha4 AWSClusterRoleIdentity receiver to a v1beta1 AWSClusterRoleIdentity. 51 func (src *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { 52 dst := dstRaw.(*infrav1.AWSClusterRoleIdentity) 53 return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(src, dst, nil) 54 } 55 56 // ConvertFrom converts the v1beta1 AWSClusterRoleIdentity to a v1alpha4 AWSClusterRoleIdentity. 57 func (dst *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error { 58 src := srcRaw.(*infrav1.AWSClusterRoleIdentity) 59 60 return Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(src, dst, nil) 61 } 62 63 // ConvertTo converts the v1alpha4 AWSClusterRoleIdentityList receiver to a v1beta1 AWSClusterRoleIdentityList. 64 func (src *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { 65 dst := dstRaw.(*infrav1.AWSClusterRoleIdentityList) 66 return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(src, dst, nil) 67 } 68 69 // ConvertFrom converts the v1beta1 AWSClusterRoleIdentityList to a v1alpha4 AWSClusterRoleIdentityList. 70 func (dst *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error { 71 src := srcRaw.(*infrav1.AWSClusterRoleIdentityList) 72 73 return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(src, dst, nil) 74 } 75 76 // ConvertTo converts the v1alpha4 AWSClusterStaticIdentity receiver to a v1beta1 AWSClusterStaticIdentity. 77 func (src *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { 78 dst := dstRaw.(*infrav1.AWSClusterStaticIdentity) 79 return Convert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(src, dst, nil) 80 } 81 82 // ConvertFrom converts the v1beta1 AWSClusterStaticIdentity to a v1alpha4 AWSClusterStaticIdentity. 83 func (dst *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error { 84 src := srcRaw.(*infrav1.AWSClusterStaticIdentity) 85 86 return Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(src, dst, nil) 87 } 88 89 // ConvertTo converts the v1alpha4 AWSClusterStaticIdentityList receiver to a v1beta1 AWSClusterStaticIdentityList. 90 func (src *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { 91 dst := dstRaw.(*infrav1.AWSClusterStaticIdentityList) 92 return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(src, dst, nil) 93 } 94 95 // ConvertFrom converts the v1beta1 AWSClusterStaticIdentityList to a v1alpha4 AWSClusterStaticIdentityList. 96 func (dst *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error { 97 src := srcRaw.(*infrav1.AWSClusterStaticIdentityList) 98 99 return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(src, dst, nil) 100 }