terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
🐛 Fix Pod spec toleration when the spec is a template
Description
This PR updates the logic of resources that use the Pod specification template and now the provider will keep all tolerations(spec.toleration) returned by Kubernetes. The same is applicable for the data sources kubernetes_pod_v1 and kubernetes_pod. The behavior of resources kubernetes_pod_v1 and kubernetes_pod remains unchanged, i.e. the provider will keep removing tolerations with well-known taints since they might be attached to the object by Kubernetes controller and could lead to a perpetual diff.
Affected resources and data sources:
resource/kubernetes_replication_controllerresource/kubernetes_replication_controller_v1resource/kubernetes_stateful_setresource/kubernetes_stateful_set_v1resource/kubernetes_deploymentresource/kubernetes_deployment_v1resource/kubernetes_daemonsetresource/kubernetes_daemon_set_v1resource/kubernetes_cron_jobresource/kubernetes_cron_job_v1resource/kubernetes_jobresource/kubernetes_job_v1data_source/kubernetes_poddata_source/kubernetes_pod_v1
Acceptance tests
- [X] Have you added an acceptance test for the functionality being added?
- [X] Have you run the acceptance tests on this branch?
Release Note
Release note for CHANGELOG:
We have updated the logic of resources that use the Pod specification template, such as `kubernetes_deployment_v1`, `kubernetes_stateful_set_v1`, etc, and now the provider will keep all tolerations(`spec.toleration`) returned by Kubernetes. The same is applicable for the data sources `kubernetes_pod_v1` and `kubernetes_pod`. The behavior of resources `kubernetes_pod_v1` and `kubernetes_pod` remains unchanged, i.e. the provider will keep removing tolerations with well-known [taints](https://kubernetes.io/docs/reference/labels-annotations-taints/) since they might be attached to the object by Kubernetes controller and could lead to a perpetual diff.
Fix an issue when the provider cuts out toleration under pod spec template(`*.template.spec.toleration`) if it uses a well-known [taint](https://kubernetes.io/docs/reference/labels-annotations-taints/). That could lead to a perpetual diff behavior.
References
Fix: https://github.com/hashicorp/terraform-provider-kubernetes/issues/2376
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Hello @arybolovlev
Any expected date for when this will be merged? Will it be for v2.26 only or as a patch to v2.25?
Best regards