Skip to content

Commit

Permalink
Merge pull request #5182 from detiber/kcpUpgradeNPE
Browse files Browse the repository at this point in the history
🐛 [e2e framework] Avoid NPE when KCP does not specify ClusterConfiguration
  • Loading branch information
k8s-ci-robot authored Sep 1, 2021
2 parents 95cb704 + 7601ebd commit fde4fcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/framework/controlplane_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ func UpgradeControlPlaneAndWaitForUpgrade(ctx context.Context, input UpgradeCont
Expect(err).ToNot(HaveOccurred())

input.ControlPlane.Spec.Version = input.KubernetesUpgradeVersion

// If the ClusterConfiguration is not specified, create an empty one.
if input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration == nil {
input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration = new(bootstrapv1.ClusterConfiguration)
}

input.ControlPlane.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd = bootstrapv1.Etcd{
Local: &bootstrapv1.LocalEtcd{
ImageMeta: bootstrapv1.ImageMeta{
Expand Down

0 comments on commit fde4fcb

Please sign in to comment.