-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes label validation is invalid #206
Comments
Try this: resource "kubernetes_namespace" "foobar" {
metadata {
labels {
"foo/bar" = ""
}
name = "foobar"
}
} |
@ctranstrum at first I thought your solution worked , because indeed works for the first time , but in the next apply is not able to process the '/' from the state and does not read the label correctly and at the end you have a perpetual diff. 'terraform show' does not display the label but I can see it with the kubetcl |
I am having the same issue . Terraform is applying the labels but at every run it sets them again for example:
I can see that those labels where indeed set on the resource. Is there a correct way to apply this kind of "complex" labels through the terraform kubernetes provider ? |
I'm also having this issue. I'm stuck with a perpetual diff when trying to use labels that have keys that are quoted and have a |
Looks like this is caused by this fix for this previous bug, from when Terraform didn't allow label names to contain Now that we're using the upstream k8s libraries to validate label names and can set labels with names containing |
So is there a workaround? |
bump having the same issues with |
Having same issue with kubernetes_config_map |
The issue reported by the OP does not happen with recent versions. For example, this works fine:
|
I can confirm what @pdecat has demonstrated above. I am also not able to reproduce this issue anymore. It works correctly using these versions:
Here's the configuration I used: terraform {
required_version = "0.12.2"
}
resource "kubernetes_config_map" "foobar" {
metadata {
labels = {
"foo/bar" = "some-data"
}
name = "foobar"
}
} |
I'm going to close this issue. |
Terraform Version
Affected Resource(s)
I noticed this with
kubernetes_namespace
but it might affect others too?Terraform Configuration Files
Actual Behavior
In the above example
terraform
does not accept the label:Expected Behavior
It should apply cleanly.
The documentation states:
Steps to Reproduce
See above.
The text was updated successfully, but these errors were encountered: