Make secret creation idempotent

This commit is contained in:
Marco Nenciarini 2022-02-22 16:28:57 +01:00
parent e4b8327fde
commit 2dfff00848
No known key found for this signature in database
GPG Key ID: 589F03F01BA55038

View File

@ -120,8 +120,8 @@ resource "null_resource" "kustomization" {
provisioner "remote-exec" {
inline = [
"set -ex",
"kubectl -n kube-system create secret generic hcloud --from-literal=token=${var.hcloud_token} --from-literal=network=${hcloud_network.k3s.name}",
"kubectl -n kube-system create secret generic hcloud-csi --from-literal=token=${var.hcloud_token}",
"kubectl -n kube-system create secret generic hcloud --from-literal=token=${var.hcloud_token} --from-literal=network=${hcloud_network.k3s.name} --dry-run=client -o yaml | kubectl apply -f -",
"kubectl -n kube-system create secret generic hcloud-csi --from-literal=token=${var.hcloud_token} --dry-run=client -o yaml | kubectl apply -f -",
]
}