grafana / crossplane-provider-grafana

Crossplane provider of https://github.com/grafana/terraform-provider-grafana. Generated by https://github.com/upbound/upjet
Apache License 2.0
26 stars 14 forks source link

Unable to move a folder to another parent folder #148

Closed jleafe closed 3 months ago

jleafe commented 4 months ago

When updating a folder that has an existing parent folder, it cannot be moved to another parent. We are using version v0.15.0

Warning CannotUpdateExternalResource 5m44s (x38 over 85m) managed/oss.grafana.crossplane.io/v1alpha1, kind=folder refuse to update the external resource because the following update requires replacing it: cannot change the value of the argument "parent_folder_uid" from "ddme6mdu6amtcd" to "adme6lrz2sge8d"

Is this something that will be supported in an upcoming release as Grafana 11 now supports sub folders?

julienduchesne commented 3 months ago

You are right. The parent folder field is immutable. This is, however, as designed in Crossplane: https://docs.crossplane.io/latest/concepts/managed-resources/#immutable-fields

Crossplane behaves differently than other tools like Terraform. Terraform deletes and recreates a resource to change an immutable field. Crossplane only deletes an external resource if their corresponding managed resource object is deleted from Kubernetes and the deletionPolicy is Delete.

There is no way to force the re-creation of a resource in Crossplane other than by issuing a "delete" call directly. I believe this is the issue that is used in Crossplane to track this: https://github.com/crossplane/upjet/issues/78