grafana-operator icon indicating copy to clipboard operation
grafana-operator copied to clipboard

DataSource needs to be managed through grafana API

Open guimou opened this issue 3 years ago • 6 comments

Hi! When creating a DataSource through OpenShift Advanced Cluster Management, ACM, the datasource does not work. Other components (dashboard, Grafana instance works well). The exact same deployment through an oc apply -k (like what ACM is doing) works perfectly.

We were able to pinpoint the problem. ACM is adding this in the GrafanaDataSource CR metadata:

ownerReferences:
  - apiVersion: apps.open-cluster-management.io/v1
    kind: Subscription
    name: grafana-ramendemo-configuration-subscription-1-local
    uid: b0b00735-ac72-4b10-bc6d-a88972feec6a

When the ownerReferences section is removed manually, the operator picks up the DataSource and refreshes the deployment.

Version 3.10.3

To Reproduce Create a datasource with the standard YAML config, and apply it through an ACM deployment.

Expected behavior Datasource is picked up by the operator regarless of owner information.

Runtime (please complete the following information):

  • Grafana Operator Version: 3.10.3
  • Environment: Openshift 4.8
  • Deployment type: Operator deployed, using ACM to create Grafana resources

guimou avatar Dec 15 '21 17:12 guimou

@guimou can you please try version 4.1.0 (4.1.1) will be released soon instead. Not that I think it will help but we will most likely not backport any fix around this issue to v3 so you will have to upgrade to v4 no matter what.

NissesSenap avatar Dec 16 '21 07:12 NissesSenap

If it works with dashboard but not with datasource it's probably thanks to that we are using a configmap to insert the datasource.

As mentioned in: https://github.com/grafana-operator/grafana-operator/issues/652 We should ideally start using the http API to interact with data sources So that would probably solve this issue while remove some technical debt.

NissesSenap avatar Dec 16 '21 07:12 NissesSenap

This issue hasn't been updated for a while, marking as stale, please respond within the next 7 days to remove this label

github-actions[bot] avatar Jan 15 '22 08:01 github-actions[bot]

@guimou we expect to fix this when switching to the API for data sources.

pb82 avatar Jan 18 '22 12:01 pb82

OK, no worries. Do you want to leave this open til then, or do we close it?

guimou avatar Jan 18 '22 13:01 guimou

We will keep it open, it's a good way to track it.

NissesSenap avatar Jan 18 '22 14:01 NissesSenap

Resolved in #919

hubeadmin avatar Mar 14 '23 14:03 hubeadmin