Terraform v0.14.0
variable "k8s_host" {
type = string
}
variable "client_certificate" {
type = string
}
variable "client_key" {
type = string
}
variable "cluster_ca_certificate" {
type = string
}
provider "kubernetes" {
host = var.k8s_host
client_certificate = base64decode(var.client_certificate)
client_key = base64decode(var.client_key)
cluster_ca_certificate = base64decode(var.cluster_ca_certificate)
}
resource "kubernetes_namespace" "test" {
metadata {
name = "test"
labels = {}
annotations = {}
}
lifecycle {
ignore_changes = [
metadata
]
}
}
https://gist.github.com/loispostula/37c061ebcfc1534c0b868d0b6b00f298
Plan should return that there are no changes
Plan is crashing because:
Error: "metadata.0.resource_version": this field cannot be setError: "metadata.0.self_link": this field cannot be setError: "metadata.0.uid": this field cannot be setError: "metadata.0.generate_name": conflicts with metadata.0.nameError: "metadata.0.generation": this field cannot be setError: "metadata.0.name": conflicts with metadata.0.generate_nameterraform initterraform apply -auto-approveterraform initterraform apply -auto-approveHi @loispostula, I was able to replicate your issue. This appears to be caused by an upstream Terraform bug related to lifecycle. Please see https://github.com/hashicorp/terraform/pull/27141
It looks like the Terraform Core team is in the process of releasing a fix. I'll leave this comment open until the issue is resolved.
Terraform released v0.14.1 with a fix for this issue. Can you please try with the new version and let us know if this is resolved for you?
Hi @redeux Tested with v0.14.2 and it's indeed fixed, thanks for identifying the issue
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!