Skip to content

Commit e88bd16

Browse files
committed
Add the compatibility for Patches field in public and upstream API's
1 parent bc7b235 commit e88bd16

File tree

6 files changed

+49
-31
lines changed

6 files changed

+49
-31
lines changed

bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.conversion.go

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta3/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,4 @@ type Patches struct {
455455
// first alpha-numerically.
456456
// +optional
457457
Directory string `json:"directory,omitempty"`
458-
}
458+
}

controlplane/kubeadm/api/v1alpha3/conversion.go

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ func (src *KubeadmControlPlane) ConvertTo(dstRaw conversion.Hub) error {
5656
}
5757

5858
dst.Spec.KubeadmConfigSpec.Ignition = restored.Spec.KubeadmConfigSpec.Ignition
59+
if restored.Spec.KubeadmConfigSpec.InitConfiguration != nil {
60+
dst.Spec.KubeadmConfigSpec.InitConfiguration.Patches = restored.Spec.KubeadmConfigSpec.InitConfiguration.Patches
61+
}
62+
if restored.Spec.KubeadmConfigSpec.JoinConfiguration != nil {
63+
dst.Spec.KubeadmConfigSpec.JoinConfiguration.Patches = restored.Spec.KubeadmConfigSpec.JoinConfiguration.Patches
64+
}
5965

6066
return nil
6167
}

controlplane/kubeadm/api/v1alpha4/conversion.go

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ func (src *KubeadmControlPlane) ConvertTo(dstRaw conversion.Hub) error {
3939
}
4040

4141
dst.Spec.KubeadmConfigSpec.Ignition = restored.Spec.KubeadmConfigSpec.Ignition
42+
if restored.Spec.KubeadmConfigSpec.InitConfiguration != nil {
43+
dst.Spec.KubeadmConfigSpec.InitConfiguration.Patches = restored.Spec.KubeadmConfigSpec.InitConfiguration.Patches
44+
}
45+
if restored.Spec.KubeadmConfigSpec.JoinConfiguration != nil {
46+
dst.Spec.KubeadmConfigSpec.JoinConfiguration.Patches = restored.Spec.KubeadmConfigSpec.JoinConfiguration.Patches
47+
}
4248

4349
return nil
4450
}
@@ -81,6 +87,12 @@ func (src *KubeadmControlPlaneTemplate) ConvertTo(dstRaw conversion.Hub) error {
8187

8288
dst.Spec.Template.Spec.KubeadmConfigSpec.Ignition = restored.Spec.Template.Spec.KubeadmConfigSpec.Ignition
8389
dst.Spec.Template.Spec.MachineTemplate = restored.Spec.Template.Spec.MachineTemplate
90+
if restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration != nil {
91+
dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.Patches = restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.Patches
92+
}
93+
if restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration != nil {
94+
dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.Patches = restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.Patches
95+
}
8496

8597
return nil
8698
}

0 commit comments

Comments
 (0)