fix: Fix stale append_tolerations when removed from the terraform configuration#2244
fix: Fix stale append_tolerations when removed from the terraform configuration#2244skanakal wants to merge 1 commit into
Conversation
|
What happens if you don't include the append_tolerations in your config with this change? Will it unexpectedly clear them out? Wouldn't that be a breaking change for existing configurations? |
|
This repo requires commits to be signed by a verified key, please see Github's docs for how to do that. |
Here is the current schema, https://github.com/rancher/terraform-provider-rancher2/blob/main/rancher2/schema_agent_deployment_customization.go#L37-L43 Do you mean even though the current schema suggests they are distinguishable, this relies on terraform behavior rather than explicit state comparison... |
Addresses #2207
Description
The provider currently omits append_tolerations from the rancher api payload when the terraform list becomes empty because the expander gates assignment n len(v) > 0, this prevents rancher from receiving an explicit empty list and causes stale tolerations to persist on the cluster spec.
so removing the length guard and preserves field presence whenever the terraform key exists. This allows the provider to serializes explicit empty slices and enables proper removal for append_tolerations
Testing
Not a breaking change.