rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
259 stars 223 forks source link

[BUG] can't remove machine_labels or taints from existing machine_pools #1280

Open lestich opened 9 months ago

lestich commented 9 months ago

Rancher Server Setup

Information about the Cluster

User Information

Provider Information

Describe the bug

We have different nodepools created by the tf-resource rancher2_cluster_v2 . Some of the nodepools have machine_labels and taints attached. If we want to remove an machine_label or taint from an existing nodepool (i.e. setting the machine_labels inside the dynamic "machine_pools" to {}) terraform just ignores it.

The corresponding code is here: https://github.com/rancher/terraform-provider-rancher2/blob/master/rancher2/structure_cluster_v2_rke_config_machine_pool.go#L69

To Reproduce

Create a nodepool via the rancher2_cluster_v2 tf ressource and try to remove machine_labels / taints by setting the map to null or an empty map

Actual Result

nothing happens

Expected Result

The labels / taints should be removed i.e. the check for len > 0 should be removed.

Screenshots

Additional context

pvlkov commented 9 months ago

+1 also running into this issue

br0nwe commented 6 months ago

+1