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

Cannot delete dashboards with invalid JSON #105

Closed simwak closed 5 months ago

simwak commented 5 months ago

A dashboard that was first successfully created with a valid JSON cannot be deleted after it has been updated with an invalid JSON.

Steps to reproduce

  1. Create dashboard with:
    apiVersion: oss.grafana.crossplane.io/v1alpha1
    kind: Dashboard
    metadata:
    name: test-dashboard
    spec:
    forProvider:
    configJson: |
      {
        "title": "Crossplane Test!",
        "uid": "crossplane"
      }
    providerConfigRef:
    name: default
  2. Update it with:
    apiVersion: oss.grafana.crossplane.io/v1alpha1
    kind: Dashboard
    metadata:
    name: test-dashboard
    spec:
    forProvider:
    configJson: |
      {
        "title": "Crossplane Test!",
        "uid": "crossplane"
    providerConfigRef:
    name: default
  3. kubectl delete dashboard test-dashboard

The deletion is stuck until it is updated again with valid JSON. I would expect it to use the referenced dashboard that was last successfully applied (status.atProvider.id) and delete it.

julienduchesne commented 5 months ago

Seems to be fixed in the latest release!