Skip to content

Commit fd7d64a

Browse files
committed
feat: make patch as default and switch to tofu
1 parent 13f9e26 commit fd7d64a

File tree

9 files changed

+13
-147
lines changed

9 files changed

+13
-147
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
repos:
2-
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.86.0
2+
- repo: https://github.com/tofuutils/pre-commit-opentofu
3+
rev: 65ac74a0fd483b19b93293918c088067a9979e6d
44
hooks:
5-
- id: terraform_fmt
6-
- id: terraform_checkov
7-
- id: terraform_tflint
5+
- id: tofu_fmt
6+
- id: tofu_checkov
7+
- id: tofu_tflint
8+
#- id: tofu_trivy

examples/single-server/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ EOF
9292
ff_write_kubeconfig = true
9393
# deploy etcd backup
9494
ff_native_backup = true
95+
# wait for the cluster to be ready when deploying
96+
ff_wait_ready = true
9597

9698
identity_endpoint = "https://api.pub1.infomaniak.cloud/identity"
9799
object_store_endpoint = "s3.pub1.infomaniak.cloud"

main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,20 @@ module "servers" {
9191
lb_provider = var.lb_provider
9292
cluster_name = var.name
9393
}),
94-
(var.ff_patches ? "patches/rke2-cilium.yaml" : "cilium.yaml") : templatefile(var.ff_patches ? "${path.module}/patches/rke2-cilium.yaml.tpl" : "${path.module}/manifests/cilium.yaml.tpl", {
94+
"patches/rke2-cilium.yaml" : templatefile("${path.module}/patches/rke2-cilium.yaml.tpl", {
9595
operator_replica = local.operator_replica
9696
apiserver_host = local.internal_vip
9797
cluster_name = var.name
9898
cluster_id = var.cluster_id
9999
}),
100-
(var.ff_patches ? "patches/rke2-coredns.yaml" : "coredns.yaml") : templatefile(var.ff_patches ? "${path.module}/patches/rke2-coredns.yaml.tpl" : "${path.module}/manifests/coredns.yaml.tpl", {
100+
"patches/rke2-coredns.yaml" : templatefile("${path.module}/patches/rke2-coredns.yaml.tpl", {
101101
operator_replica = local.operator_replica
102102
}),
103-
(var.ff_patches ? "patches/rke2-metrics-server.yaml" : "metrics-server.yaml") : templatefile(var.ff_patches ? "${path.module}/patches/rke2-metrics-server.yaml.tpl" : "${path.module}/manifests/metrics-server.yaml.tpl", {
103+
"patches/rke2-metrics-server.yaml" : templatefile("${path.module}/patches/rke2-metrics-server.yaml.tpl", {
104104
}),
105-
(var.ff_patches ? "patches/rke2-snapshot-controller.yaml" : "snapshot-controller.yaml") : templatefile(var.ff_patches ? "${path.module}/patches/rke2-snapshot-controller.yaml.tpl" : "${path.module}/manifests/snapshot-controller.yaml.tpl", {
105+
"patches/rke2-snapshot-controller.yaml" : templatefile("${path.module}/patches/rke2-snapshot-controller.yaml.tpl", {
106106
}),
107-
(var.ff_patches ? "patches/rke2-snapshot-validation-webhook.yaml" : "snapshot-validation-webhook.yaml") : templatefile(var.ff_patches ? "${path.module}/patches/rke2-snapshot-validation-webhook.yaml.tpl" : "${path.module}/manifests/snapshot-validation-webhook.yaml.tpl", {
107+
"patches/rke2-snapshot-validation-webhook.yaml" : templatefile("${path.module}/patches/rke2-snapshot-validation-webhook.yaml.tpl", {
108108
}),
109109
},
110110
{

manifests/cilium.yaml.tpl

Lines changed: 0 additions & 61 deletions
This file was deleted.

manifests/coredns.yaml.tpl

Lines changed: 0 additions & 32 deletions
This file was deleted.

manifests/metrics-server.yaml.tpl

Lines changed: 0 additions & 13 deletions
This file was deleted.

manifests/snapshot-controller.yaml.tpl

Lines changed: 0 additions & 13 deletions
This file was deleted.

manifests/snapshot-validation-webhook.yaml.tpl

Lines changed: 0 additions & 13 deletions
This file was deleted.

variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,3 @@ variable "ff_wait_ready" {
287287
type = bool
288288
default = true
289289
}
290-
291-
variable "ff_patches" {
292-
type = bool
293-
default = false
294-
}

0 commit comments

Comments
 (0)