terraform-provider-rancher2 icon indicating copy to clipboard operation
terraform-provider-rancher2 copied to clipboard

Setting labels on a cluster resource removes "provider.cattle.io" or detects it as a change

Open erSitzt opened this issue 2 years ago • 2 comments

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

erSitzt avatar Jan 07 '22 15:01 erSitzt

using

    rancher2 = {
      source = "rancher/rancher2"
      version = "1.22.1"
    }

with Rancher v2.6.3

erSitzt avatar Jan 07 '22 15:01 erSitzt

same with 1.22.2

erSitzt avatar Jan 07 '22 15:01 erSitzt

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
  )

strowi avatar Nov 15 '22 11:11 strowi

We see very similar behavior:

CleanShot 2023-03-27 at 10 38 25

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.

spkane avatar Mar 27 '23 17:03 spkane

Still happening with v3.0.1

erSitzt avatar Jun 09 '23 10:06 erSitzt