terraform-provider-rancher2
terraform-provider-rancher2 copied to clipboard
Setting labels on a cluster resource removes "provider.cattle.io" or detects it as a change
Hi,
i tried settings labels on a cluster (imported rke2) for use with fleet and noticed it wanted to remove the label
provider.cattle.io = rke2
Because the label is automatically recreated this is detected as a change every time
using
rancher2 = {
source = "rancher/rancher2"
version = "1.22.1"
}
with Rancher v2.6.3
same with 1.22.2
1.23.0
still happening with an imported cluster.
Adding the following removes the change as a workaround:
labels = merge(
{
"provider.cattle.io" = "k3s",
},
var.rancher_cluster_labels
)
We see very similar behavior:
It would be nice if the provider was updated to ignore any dynamic labels that Rancher is known to change internally. This is common in providers like Kubernetes and AWS, where it is known that some labels are dynamic and managed by the underlying system and not the user.
Still happening with v3.0.1