Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dashboard cache (sequence of actions) #835

Merged
merged 1 commit into from Oct 11, 2022

Conversation

weisdd
Copy link
Collaborator

@weisdd weisdd commented Oct 7, 2022

Description

With url-based dashboards, a few status fields are supposed to be used for caching. It doesn't happen though, because the r.refreshDashboard() call (fetches the latest version of CR) is made right after the r.Dashboard.Status is prepared, effectively dropping all cache data.

This PR restores correct sequence of actions.

Relevant issues/tickets

Fixes: #832

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • This change requires a documentation update
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a test case that will be used to verify my changes
  • Verified independently on a cluster by reviewer

Verification steps

  1. Deploy something like:
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDashboard
metadata:
  name: grafana-dashboard-from-url
  labels:
    app.kubernetes.io/instance: grafana-operator
spec:
  url: https://grafana.com/api/dashboards/11176/revisions/1/download
  1. Cache data in CR status fields should get populated.

Copy link
Collaborator

@HubertStefanski HubertStefanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HubertStefanski HubertStefanski merged commit 87acecc into grafana:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] contentCache is not used for url-based dashboards
2 participants