Created
October 9, 2020 15:46
-
-
Save ncdc/3ca83a856674d86c263f663bae1dddd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go b/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go | |
index 41ccef8c4..fa157f97a 100644 | |
--- a/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go | |
+++ b/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go | |
@@ -1,4 +1,4 @@ | |
-// +build !ignore_autogenerated | |
+// +build !andy_kcp | |
/* | |
Copyright The Kubernetes Authors. | |
@@ -26,8 +26,9 @@ import ( | |
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
conversion "k8s.io/apimachinery/pkg/conversion" | |
runtime "k8s.io/apimachinery/pkg/runtime" | |
- apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" | |
+ clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" | |
apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" | |
+ apiv1alpha3 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" | |
v1alpha4 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" | |
errors "sigs.k8s.io/cluster-api/errors" | |
) | |
@@ -116,7 +117,17 @@ func Convert_v1alpha4_KubeadmControlPlane_To_v1alpha3_KubeadmControlPlane(in *v1 | |
func autoConvert_v1alpha3_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(in *KubeadmControlPlaneList, out *v1alpha4.KubeadmControlPlaneList, s conversion.Scope) error { | |
out.ListMeta = in.ListMeta | |
- out.Items = *(*[]v1alpha4.KubeadmControlPlane)(unsafe.Pointer(&in.Items)) | |
+ if in.Items != nil { | |
+ in, out := &in.Items, &out.Items | |
+ *out = make([]v1alpha4.KubeadmControlPlane, len(*in)) | |
+ for i := range *in { | |
+ if err := Convert_v1alpha3_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(&(*in)[i], &(*out)[i], s); err != nil { | |
+ return err | |
+ } | |
+ } | |
+ } else { | |
+ out.Items = nil | |
+ } | |
return nil | |
} | |
@@ -127,7 +138,17 @@ func Convert_v1alpha3_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneLis | |
func autoConvert_v1alpha4_KubeadmControlPlaneList_To_v1alpha3_KubeadmControlPlaneList(in *v1alpha4.KubeadmControlPlaneList, out *KubeadmControlPlaneList, s conversion.Scope) error { | |
out.ListMeta = in.ListMeta | |
- out.Items = *(*[]KubeadmControlPlane)(unsafe.Pointer(&in.Items)) | |
+ if in.Items != nil { | |
+ in, out := &in.Items, &out.Items | |
+ *out = make([]KubeadmControlPlane, len(*in)) | |
+ for i := range *in { | |
+ if err := Convert_v1alpha4_KubeadmControlPlane_To_v1alpha3_KubeadmControlPlane(&(*in)[i], &(*out)[i], s); err != nil { | |
+ return err | |
+ } | |
+ } | |
+ } else { | |
+ out.Items = nil | |
+ } | |
return nil | |
} | |
@@ -140,8 +161,7 @@ func autoConvert_v1alpha3_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlan | |
out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) | |
out.Version = in.Version | |
out.InfrastructureTemplate = in.InfrastructureTemplate | |
- // TODO: Inefficient conversion - can we improve it? | |
- if err := s.Convert(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, 0); err != nil { | |
+ if err := apiv1alpha3.Convert_v1alpha3_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { | |
return err | |
} | |
out.UpgradeAfter = (*v1.Time)(unsafe.Pointer(in.UpgradeAfter)) | |
@@ -158,8 +178,7 @@ func autoConvert_v1alpha4_KubeadmControlPlaneSpec_To_v1alpha3_KubeadmControlPlan | |
out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) | |
out.Version = in.Version | |
out.InfrastructureTemplate = in.InfrastructureTemplate | |
- // TODO: Inefficient conversion - can we improve it? | |
- if err := s.Convert(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, 0); err != nil { | |
+ if err := apiv1alpha3.Convert_v1alpha4_KubeadmConfigSpec_To_v1alpha3_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { | |
return err | |
} | |
out.UpgradeAfter = (*v1.Time)(unsafe.Pointer(in.UpgradeAfter)) | |
@@ -203,7 +222,7 @@ func autoConvert_v1alpha4_KubeadmControlPlaneStatus_To_v1alpha3_KubeadmControlPl | |
out.FailureReason = errors.KubeadmControlPlaneStatusError(in.FailureReason) | |
out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) | |
out.ObservedGeneration = in.ObservedGeneration | |
- out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) | |
+ out.Conditions = *(*clusterapiapiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) | |
return nil | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment