grafana / grafana-operator

An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
https://grafana.github.io/grafana-operator/
Apache License 2.0
863 stars 384 forks source link

feat: Add folderUID and folderRef in GrafanaDashboard CRD #1601

Closed aboulay-numspot closed 1 month ago

aboulay-numspot commented 2 months ago

Aim of the merge request

This MR aims to implement the content of the document discussed in maintainer meeting (currently under #1592).

The features are the following: If folder is set and none of the other fields is set (backwards compat. case): Create the folder If folderUID or folderRef is set, don't create the folder If folderUID or folderRef AND folder is set, the new fields take priority -> don't create the folder

Breaking change

There is no breaking change. We implement on the top of existing GrafanaDashboard CR behavior.

aboulay-numspot commented 2 months ago

@theSuess - I know you are interested about this implementation. If it can help you to propose something even better, feel free to propose an evolution in a dedicated MR and close this one.

theSuess commented 2 months ago

Waiting for https://github.com/grafana/grafana-operator/pull/1604 to be merged first as it introduces shared logic we can reuse here

aboulay-numspot commented 1 month ago

@theSuess I have updated the GrafanaDashboard CR to match with the interface. To do this, I have added a Condition block into the GrafanaDashboard.Status and add the state update into the Reconciliation loop. I removed the duplicated code with the interface developed in the GrafanaFolder MR (#1604).

Can you have a look on it? I don't understand the full meaning of the Condition object, I would be happy if someone can give me some feedback into this implementation.

I think I'm ready for a review this time.