Open rootwyrm opened 1 year ago
Hi @rootwyrm, we are going to reproduce this issue to understand what exactly the issue may be.
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!
@rootwyrm This isn't reproducible anymore with the latest version of Terraform and the provider. Can you please confirm on your side if this is still an issue using these current versions?
➜ issue-K2068 terraform plan
data.local_file.eck_operator: Reading...
data.local_file.eck_operator_crd: Reading...
data.local_file.eck_operator: Read complete after 0s [id=616b3904c95831f554893a66833ba5aea68c4493]
data.local_file.eck_operator_crd: Read complete after 0s [id=d481659af3f4be74f07b01bd8b0feed7ffba6a47]
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--stackconfigpolicies.stackconfigpolicy.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--elasticmapsservers.maps.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--beats.beat.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--elasticsearchautoscalers.autoscaling.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--enterprisesearches.enterprisesearch.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--logstashes.logstash.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--kibanas.kibana.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--apmservers.apm.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--elasticsearches.elasticsearch.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator_crds["CustomResourceDefinition--agents.agent.k8s.elastic.co"]: Refreshing state...
kubernetes_manifest.eck_operator["ConfigMap--elastic-operator"]: Refreshing state...
kubernetes_manifest.eck_operator["ClusterRoleBinding--elastic-operator"]: Refreshing state...
kubernetes_manifest.eck_operator["ServiceAccount--elastic-operator"]: Refreshing state...
kubernetes_manifest.eck_operator["ClusterRole--elastic-operator-edit"]: Refreshing state...
kubernetes_manifest.eck_operator["Secret--elastic-webhook-server-cert"]: Refreshing state...
kubernetes_manifest.eck_operator["Namespace--elastic-system"]: Refreshing state...
kubernetes_manifest.eck_operator["Service--elastic-webhook-server"]: Refreshing state...
kubernetes_manifest.eck_operator["ClusterRole--elastic-operator-view"]: Refreshing state...
kubernetes_manifest.eck_operator["ClusterRole--elastic-operator"]: Refreshing state...
kubernetes_manifest.eck_operator["StatefulSet--elastic-operator"]: Refreshing state...
kubernetes_manifest.eck_operator["ValidatingWebhookConfiguration--elastic-webhook.k8s.elastic.co"]: Refreshing state...
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
➜ issue-K2068 terraform version
Terraform v1.8.0
on darwin_arm64
+ provider registry.terraform.io/hashicorp/kubernetes v2.29.0
+ provider registry.terraform.io/hashicorp/local v2.5.1
May I also add that these versions also include a better alternative to the split()
function trick, specifically dedicated functions to decode multi-doc YAML manifests natively.
Have a look at the example here: https://www.hashicorp.com/blog/terraform-1-8-adds-provider-functions-for-aws-google-cloud-and-kubernetes#terraform-kubernetes-provider
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
Please note this is a partial example to demonstrate reproduction as the full config is too large and contains sensitive information. To reproduce, obtain the official Elastic Search operator from ElasticSearch here.
Debug Output
Comprehensive debug is unavailable due to sensitive data and size.
Example partial output:
Demonstrating the problem on Terraform 1.3.9 to show that creationTimestamp was also not honored. Note that this behaves identically with
object.metadata.creationTimestamp
andmetadata.creationTimestamp
; only one is shown for brevity.Steps to Reproduce
terraform plan; terraform apply
terraform plan
will show on every subsequent run thatmetadata.labels
andwebhooks.clientConfig.caBundle
are to be updated in place even though both are listed as acomputed_field
.Expected Behavior
metadata.labels
andwebhooks.clientConfig.caBundle
should be treated as a computed field due to explicit listing.Actual Behavior
Terraform will attempt to apply changes to computed_fields on every run.
Important Factoids
split()
is because this is specifically a multi-part YAML.metadata.creationTimestamp
was also not honored incomputed_fields
object.*
does not change behavior; Terraform will always attempt to update bothmetadata.labels
andwebhook.clientConfig.caBundle
.References
creationTimestamp
, it was not being treated as a computed value previouslyCommunity Note