From 17d0638ab508ff679b0a3472e64936d432522301 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Wed, 8 Jun 2022 10:27:26 -0700 Subject: [PATCH 17/34] Parse provider-id from kubelet extra args Signed-off-by: Vignesh Goutham Ganesh --- bootstrap/kubeadm/internal/bottlerocket/bootstrap.go | 3 +++ bootstrap/kubeadm/internal/bottlerocket/bottlerocket.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go b/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go index f8f1b97cb..efdb51fef 100644 --- a/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go +++ b/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go @@ -16,6 +16,9 @@ standalone-mode = true authentication-mode = "tls" server-tls-bootstrap = false pod-infra-container-image = "{{.PauseContainerSource}}" +{{- if (ne .ProviderId "")}} +provider-id = "{{.ProviderId}}" +{{- end -}} {{- end -}} ` diff --git a/bootstrap/kubeadm/internal/bottlerocket/bottlerocket.go b/bootstrap/kubeadm/internal/bottlerocket/bottlerocket.go index e635308ea..3a760d51a 100644 --- a/bootstrap/kubeadm/internal/bottlerocket/bottlerocket.go +++ b/bootstrap/kubeadm/internal/bottlerocket/bottlerocket.go @@ -44,6 +44,7 @@ type BottlerocketSettingsInput struct { RegistryMirrorCACert string NodeLabels string Taints string + ProviderId string } type HostPath struct { @@ -151,6 +152,7 @@ func getBottlerocketNodeUserData(bootstrapContainerUserData []byte, users []boot RegistryMirrorEndpoint: config.RegistryMirrorConfiguration.Endpoint, NodeLabels: parseNodeLabels(config.KubeletExtraArgs["node-labels"]), // empty string if it does not exist Taints: parseTaints(config.Taints), //empty string if it does not exist + ProviderId: config.KubeletExtraArgs["provider-id"], } if config.BottlerocketControl.ImageRepository != "" && config.BottlerocketControl.ImageTag != "" { bottlerocketInput.ControlContainerSource = fmt.Sprintf("%s:%s", config.BottlerocketControl.ImageRepository, config.BottlerocketControl.ImageTag) -- 2.40.0