From be3ce7326ae472dad6e2c223f35141056584e174 Mon Sep 17 00:00:00 2001 From: lukasmetzner Date: Thu, 6 Feb 2025 15:03:30 +0100 Subject: [PATCH 1/2] feat: allow setting HCLOUD_ENDPOINT env for hccm Allow setting the HCLOUD_ENDPOINT environment variable via Terraform variables for the hcloud-cloud-controller-manager. --- main-setup.tf | 5 +++++ variables.tf | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/main-setup.tf b/main-setup.tf index f074a43..3c7999c 100644 --- a/main-setup.tf +++ b/main-setup.tf @@ -180,6 +180,11 @@ resource "helm_release" "hcloud_cloud_controller_manager" { value = tostring(var.use_cloud_routes) type = "string" } + + set { + name = "env.HCLOUD_ENDPOINT.value" + value = var.hcloud_endpoint + } } resource "helm_release" "hcloud_csi_driver" { diff --git a/variables.tf b/variables.tf index 45d89f2..16c64a0 100644 --- a/variables.tf +++ b/variables.tf @@ -52,6 +52,11 @@ variable "hcloud_labels" { type = map(string) default = {} } +variable "hcloud_endpoint" { + description = "Sets the HCLOUD_ENDPOINT environment variable in the hcloud-cloud-controller-manager helm chart" + type = string + default = "https://api.hetzner.cloud/v1" +} # K3S variable "k3s_channel" { From f1dee7078810d96bf4aec5ad2a2eec48382c7d74 Mon Sep 17 00:00:00 2001 From: lukasmetzner Date: Thu, 6 Feb 2025 15:27:01 +0100 Subject: [PATCH 2/2] refactor: scope hcloud_endpoint variable to hccm --- main-setup.tf | 2 +- variables.tf | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main-setup.tf b/main-setup.tf index 3c7999c..dcb57eb 100644 --- a/main-setup.tf +++ b/main-setup.tf @@ -183,7 +183,7 @@ resource "helm_release" "hcloud_cloud_controller_manager" { set { name = "env.HCLOUD_ENDPOINT.value" - value = var.hcloud_endpoint + value = var.hccm_hcloud_endpoint } } diff --git a/variables.tf b/variables.tf index 16c64a0..951ff18 100644 --- a/variables.tf +++ b/variables.tf @@ -52,7 +52,9 @@ variable "hcloud_labels" { type = map(string) default = {} } -variable "hcloud_endpoint" { + +# hcloud-cloud-controller-manager +variable "hccm_hcloud_endpoint" { description = "Sets the HCLOUD_ENDPOINT environment variable in the hcloud-cloud-controller-manager helm chart" type = string default = "https://api.hetzner.cloud/v1"