From 2dfff00848d5e64271124b060bc65e9c0a1c5320 Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Tue, 22 Feb 2022 16:28:57 +0100 Subject: [PATCH] Make secret creation idempotent --- init.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.tf b/init.tf index 09618c5..6125242 100644 --- a/init.tf +++ b/init.tf @@ -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 -", ] }