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

Feat/Update prometheus-exporter-operator to manage possible different GrafanaDashboard apiVersions #49

Merged
merged 7 commits into from
Sep 4, 2023

Conversation

slopezz
Copy link
Member

@slopezz slopezz commented Sep 1, 2023

On #48 it was reported a bug which made the operator to fail on the management of the GrafanaDashboard custom resource, due to using an old API.

It seems there is an API change on grafana-operator v5.0.0 from June 2023 https://github.com/grafana-operator/grafana-operator/releases/tag/v5.0.0

According to the migration docs https://github.com/grafana-operator/grafana-operator/blob/master/docs/blog/v4-v5-migration.md, it affects to prometheus-exporter-operator on 2 places:

  • API Version
    • v4:integreatly.org/v1alpha1
    • v5: grafana.integreatly.org/v1beta1)
  • Label selector, so the grafana instance know which dashboards will reconcile
    • v4. it was used the usual metadata.labelX
    • v5: it uses a new field on the spec, spec.instanceSelector.matchLabels.labelX

So the operator has been adapted to have the 2 possible GrafanaDashboard apiVersions, since there is a breaking change at grafana-operator level, and it is really possible that not everybody have updated yet to newer grafana-operator v5.0.0:

  • Added new grafanaDashboard.apiVersion CRD field with the 2 possible apiVersions
  • Adapted the ansible role (defaults, tasks, template) to manage a GrafanaDashboard with the 2 different apiversion/ labelSelector depending on the value of grafanaDashboard.apiVersion (if defined in the CR), or using the default value (if not defined in the CR)
  • Default value for grafanaDashboard.apiVersion will be the old apiVersion=v1alpha1, the one used by most people at the moment
    • If you update the grafana-operator to v5.0.0, you will need to use in the CR spec.grafanaDashboard.apiVersion = v1beta1
    • In future releases, the default value will be updated to use the new apiVersion apiVersion=v1beta1
    • A new e2e test has been added to test the possible modification of the spec.grafanaDashboard.apiVersion

/kind bug
/kind feature
/priority important-soon
/assign

@3scale-robot 3scale-robot added kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next sprint. labels Sep 1, 2023
@3scale-robot 3scale-robot added needs-size Indicates a PR or issue lacks a `size/foo` label and requires one. size/M Requires about a day to complete the PR or the issue. and removed needs-size Indicates a PR or issue lacks a `size/foo` label and requires one. labels Sep 1, 2023
@3scale-robot 3scale-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2023
@3scale-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 78c8cc12e94b6ff462a09f49afc5f88f8b3c7f4d

@slopezz
Copy link
Member Author

slopezz commented Sep 4, 2023

/approve

@3scale-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: slopezz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@3scale-robot 3scale-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2023
@3scale-robot 3scale-robot merged commit 37cedb9 into main Sep 4, 2023
@3scale-robot 3scale-robot deleted the feat/grafanadashboard-api-version branch September 4, 2023 15:03
This was referenced Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next sprint. size/M Requires about a day to complete the PR or the issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants