Skip to content

Commit

Permalink
Reverted redundant changes to MachineSet and MachineDeploymentSpec co…
Browse files Browse the repository at this point in the history
…nversion code
  • Loading branch information
neeleshkorade committed Feb 9, 2020
1 parent 13c408e commit fcc777c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 41 deletions.
32 changes: 1 addition & 31 deletions api/v1alpha2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func Convert_v1alpha2_MachineSpec_To_v1alpha3_MachineSpec(in *MachineSpec, out *

if in.Bootstrap.ConfigRef != nil {
gvk := in.Bootstrap.ConfigRef.GetObjectKind().GroupVersionKind()
if gvk.Group == bootstrapv1a3.GroupVersion.Group && gvk.Kind == kubeadmConfigKind {
if gvk.Group == bootstrapv1a3.GroupVersion.Group && (gvk.Kind == kubeadmConfigKind || gvk.Kind == kubeadmConfigTemplateKind) {
out.Bootstrap.ConfigRef.APIVersion = bootstrapv1a3.GroupVersion.String()
}
}
Expand All @@ -285,36 +285,6 @@ func Convert_v1alpha2_MachineSpec_To_v1alpha3_MachineSpec(in *MachineSpec, out *
return nil
}

func Convert_v1alpha2_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *MachineSetSpec, out *v1alpha3.MachineSetSpec, s apiconversion.Scope) error {
if err := autoConvert_v1alpha2_MachineSetSpec_To_v1alpha3_MachineSetSpec(in, out, s); err != nil {
return err
}

if in.Template.Spec.Bootstrap.ConfigRef != nil {
gvk := in.Template.Spec.Bootstrap.ConfigRef.GetObjectKind().GroupVersionKind()
if gvk.Group == bootstrapv1a3.GroupVersion.Group && gvk.Kind == kubeadmConfigTemplateKind {
out.Template.Spec.Bootstrap.ConfigRef.APIVersion = bootstrapv1a3.GroupVersion.String()
}
}

return nil
}

func Convert_v1alpha2_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1alpha3.MachineDeploymentSpec, s apiconversion.Scope) error {
if err := autoConvert_v1alpha2_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in, out, s); err != nil {
return err
}

if in.Template.Spec.Bootstrap.ConfigRef != nil {
gvk := in.Template.Spec.Bootstrap.ConfigRef.GetObjectKind().GroupVersionKind()
if gvk.Group == bootstrapv1a3.GroupVersion.Group && gvk.Kind == kubeadmConfigTemplateKind {
out.Template.Spec.Bootstrap.ConfigRef.APIVersion = bootstrapv1a3.GroupVersion.String()
}
}

return nil
}

func Convert_v1alpha2_ClusterSpec_To_v1alpha3_ClusterSpec(in *ClusterSpec, out *v1alpha3.ClusterSpec, s apiconversion.Scope) error {
if err := autoConvert_v1alpha2_ClusterSpec_To_v1alpha3_ClusterSpec(in, out, s); err != nil {
return err
Expand Down
30 changes: 20 additions & 10 deletions api/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fcc777c

Please sign in to comment.