Skip to content

Commit

Permalink
Revert "add var disable_hetzner_ccm"
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticaltech authored Dec 24, 2024
1 parent 65f3a83 commit b156e47
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "github_release" "hetzner_ccm" {
count = var.hetzner_ccm_version == null && !var.disable_hetzner_ccm ? 1 : 0
count = var.hetzner_ccm_version == null ? 1 : 0
repository = "hcloud-cloud-controller-manager"
owner = "hetznercloud"
retrieve_by = "latest"
Expand Down
2 changes: 0 additions & 2 deletions kube.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ module "kube-hetzner" {

# To disable Hetzner CSI storage, you can set the following to "true", default is "false".
# disable_hetzner_csi = true
# To disable Hetzner Cloud Controller Manager, you can set the following to "true", default is "false".
# disable_hetzner_ccm = true

# If you want to use a specific Hetzner CCM and CSI version, set them below; otherwise, leave them as-is for the latest versions.
# See https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases for the available versions.
Expand Down
39 changes: 19 additions & 20 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals {
# if given as a variable, we want to use the given token. This is needed to restore the cluster
k3s_token = var.k3s_token == null ? random_password.k3s_token.result : var.k3s_token

ccm_version = length(data.github_release.hetzner_ccm) == 0 ? var.hetzner_ccm_version : data.github_release.hetzner_ccm[0].release_tag
ccm_version = var.hetzner_ccm_version != null ? var.hetzner_ccm_version : data.github_release.hetzner_ccm[0].release_tag
csi_version = length(data.github_release.hetzner_csi) == 0 ? var.hetzner_csi_version : data.github_release.hetzner_csi[0].release_tag
kured_version = var.kured_version != null ? var.kured_version : data.github_release.kured[0].release_tag
calico_version = length(data.github_release.calico) == 0 ? var.calico_version : data.github_release.calico[0].release_tag
Expand Down Expand Up @@ -74,13 +74,12 @@ locals {
kind = "Kustomization"
resources = concat(
[
"https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases/download/${local.ccm_version}/ccm-networks.yaml",
"https://github.com/kubereboot/kured/releases/download/${local.kured_version}/kured-${local.kured_version}-dockerhub.yaml",
"https://github.com/rancher/system-upgrade-controller/releases/download/${var.sys_upgrade_controller_version}/system-upgrade-controller.yaml",
"https://github.com/rancher/system-upgrade-controller/releases/download/${var.sys_upgrade_controller_version}/crd.yaml"
],
var.disable_hetzner_csi ? [] : ["hcloud-csi.yaml"],
var.disable_hetzner_ccm ? [] : ["ccm.yaml"],
var.disable_hetzner_ccm ? [] : ["https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases/download/${local.ccm_version}/ccm-networks.yaml"],
lookup(local.ingress_controller_install_resources, var.ingress_controller, []),
lookup(local.cni_install_resources, var.cni_plugin, []),
var.enable_longhorn ? ["longhorn.yaml"] : [],
Expand All @@ -89,24 +88,24 @@ locals {
var.enable_rancher ? ["rancher.yaml"] : [],
var.rancher_registration_manifest_url != "" ? [var.rancher_registration_manifest_url] : []
),
patches = concat(
[
{
target = {
group = "apps"
version = "v1"
kind = "Deployment"
name = "system-upgrade-controller"
namespace = "system-upgrade"
}
patch = file("${path.module}/kustomize/system-upgrade-controller.yaml")
},
{
path = "kured.yaml"
patches = [
{
target = {
group = "apps"
version = "v1"
kind = "Deployment"
name = "system-upgrade-controller"
namespace = "system-upgrade"
}
],
var.disable_hetzner_ccm ? [] : [{ path = "ccm.yaml" }]
)
patch = file("${path.module}/kustomize/system-upgrade-controller.yaml")
},
{
path = "kured.yaml"
},
{
path = "ccm.yaml"
}
]
})

apply_k3s_selinux = ["/sbin/semodule -v -i /usr/share/selinux/packages/k3s.pp"]
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,6 @@ variable "disable_hetzner_csi" {
description = "Disable hetzner csi driver."
}

variable "disable_hetzner_ccm" {
type = bool
default = false
description = "Disable hetzner Cloud Controller Manager."
}

variable "enable_csi_driver_smb" {
type = bool
default = false
Expand Down

0 comments on commit b156e47

Please sign in to comment.