-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed as not planned
Description
Terraform version: 1.7.4
Kubernetes provider version: 2.31.0
Kubernetes version: 1.28
I have a module called 'kube' where I create the following namespace:
resource "kubernetes_namespace" "pulsar-ns" {
metadata {
name = "pulsar2"
}
}Then in another module (which has a dependency on the kube module), so it is applied after the 'kube' module, I do:
resource "terraform_data" "prepare-pulsar-helm-release" {
provisioner "local-exec" {
command = "./prepare_helm_release.sh -k pulsar -s -n ${var.pulsar-ns}"
interpreter = ["bash", "-c"]
working_dir = path.module
}
depends_on = [var.pulsar-ns]
}When doing terraform apply, it correctly creates the namespace, but the local-exec fails with error (even though the ns exists):
exit status 1. Output: error: failed to get namespace 'pulsar2'
│ please check that this namespace exists, or use the '-c' option to create it