From 428bcd55446d86ac5c737bc0e12b08cdfbb50ae2 Mon Sep 17 00:00:00 2001 From: Taylor Neyland Date: Tue, 6 Jun 2023 16:56:24 -0500 Subject: [PATCH] Add capv support for Bottlerocket --- pkg/services/govmomi/vcenter/clone.go | 4 ++-- .../capi-upgrades/v1alpha3/cluster-template.yaml | 2 ++ .../capi-upgrades/v1alpha4/cluster-template.yaml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/services/govmomi/vcenter/clone.go b/pkg/services/govmomi/vcenter/clone.go index 999f9846..09fe9c39 100644 --- a/pkg/services/govmomi/vcenter/clone.go +++ b/pkg/services/govmomi/vcenter/clone.go @@ -60,10 +60,10 @@ func Clone(ctx *context.VMContext, bootstrapData []byte, format bootstrapv1.Form if len(bootstrapData) > 0 { ctx.Logger.Info("applied bootstrap data to VM clone spec") switch format { - case bootstrapv1.CloudConfig: - extraConfig.SetCloudInitUserData(bootstrapData) case bootstrapv1.Ignition: extraConfig.SetIgnitionUserData(bootstrapData) + default: + extraConfig.SetCloudInitUserData(bootstrapData) } } if ctx.VSphereVM.Spec.CustomVMXKeys != nil { diff --git a/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha3/cluster-template.yaml b/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha3/cluster-template.yaml index 69fe199b..73fbb0bb 100644 --- a/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha3/cluster-template.yaml +++ b/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha3/cluster-template.yaml @@ -174,6 +174,7 @@ spec: - echo "127.0.0.1 {{ ds.meta_data.hostname }}" >>/etc/hosts - echo "{{ ds.meta_data.hostname }}" >/etc/hostname useExperimentalRetryJoin: true + format: '${VSPHERE_TEMPLATE_BOOTSTRAP_FORMAT}' users: - name: capv sshAuthorizedKeys: @@ -207,6 +208,7 @@ spec: sshAuthorizedKeys: - '${VSPHERE_SSH_AUTHORIZED_KEY}' sudo: ALL=(ALL) NOPASSWD:ALL + format: '${VSPHERE_TEMPLATE_BOOTSTRAP_FORMAT}' --- apiVersion: cluster.x-k8s.io/v1alpha3 kind: MachineDeployment diff --git a/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml b/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml index 96ca172b..01394e65 100644 --- a/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml +++ b/test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml @@ -150,6 +150,7 @@ spec: - echo "127.0.0.1 {{ ds.meta_data.hostname }}" >>/etc/hosts - echo "{{ ds.meta_data.hostname }}" >/etc/hostname useExperimentalRetryJoin: true + format: '${VSPHERE_TEMPLATE_BOOTSTRAP_FORMAT}' users: - name: capv sshAuthorizedKeys: @@ -188,6 +189,7 @@ spec: sshAuthorizedKeys: - '${VSPHERE_SSH_AUTHORIZED_KEY}' sudo: ALL=(ALL) NOPASSWD:ALL + format: '${VSPHERE_TEMPLATE_BOOTSTRAP_FORMAT}' --- apiVersion: cluster.x-k8s.io/v1alpha4 kind: MachineDeployment -- 2.39.2