Skip to content

Commit 0234afe

Browse files
authored
Merge pull request #6127 from k8s-infra-cherrypick-robot/cherry-pick-5868-to-release-0.4
🐛 Fix control plane upgrade test etcd and dns image upgrade
2 parents ea09dc1 + 49f6dab commit 0234afe

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

test/framework/controlplane_helpers.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,19 +309,13 @@ func UpgradeControlPlaneAndWaitForUpgrade(ctx context.Context, input UpgradeCont
309309
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration = new(bootstrapv1.ClusterConfiguration)
310310
}
311311

312-
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd = bootstrapv1.Etcd{
313-
Local: &bootstrapv1.LocalEtcd{
314-
ImageMeta: bootstrapv1.ImageMeta{
315-
ImageTag: input.EtcdImageTag,
316-
},
317-
},
318-
}
319-
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.DNS = bootstrapv1.DNS{
320-
ImageMeta: bootstrapv1.ImageMeta{
321-
ImageTag: input.DNSImageTag,
322-
},
312+
if input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.Local == nil {
313+
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.Local = new(bootstrapv1.LocalEtcd)
323314
}
324315

316+
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.Local.ImageMeta.ImageTag = input.EtcdImageTag
317+
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.DNS.ImageMeta.ImageTag = input.DNSImageTag
318+
325319
Expect(patchHelper.Patch(ctx, input.ControlPlane)).To(Succeed())
326320

327321
log.Logf("Waiting for control-plane machines to have the upgraded kubernetes version")

0 commit comments

Comments
 (0)