Skip to content

fix: move database field to jsonData for Grafana 12.x compatibility#2266

Merged
openshift-merge-bot[bot] merged 1 commit into
stolostron:mainfrom
yanmxa:fix/grafana-12-postgres-datasource-database-field
Jan 27, 2026
Merged

fix: move database field to jsonData for Grafana 12.x compatibility#2266
openshift-merge-bot[bot] merged 1 commit into
stolostron:mainfrom
yanmxa:fix/grafana-12-postgres-datasource-database-field

Conversation

@yanmxa
Copy link
Copy Markdown
Contributor

@yanmxa yanmxa commented Jan 27, 2026

Summary

  • Move PostgreSQL datasource database field from top-level to jsonData for Grafana 12.2.0+ compatibility

Problem

Grafana 12.2.0+ requires the database field to be in jsonData instead of the top-level datasource configuration. Without this fix, users see the error:

"You do not currently have a default database configured for this data source."

Changes

  • Removed Database field from GrafanaDatasource struct
  • Added Database field to JsonData struct
  • Updated GrafanaDataSource() function to set database in JSONData

References

Test plan

  • Deploy with Grafana 12.x and verify PostgreSQL datasource works
  • Verify dashboards can query data without "default database" error

🤖 Generated with Claude Code

Grafana 12.2.0+ requires the database field to be in jsonData instead
of the top-level datasource configuration for PostgreSQL datasources.

This fixes the error: "You do not currently have a default database
configured for this data source."

Reference: grafana/grafana#112418

Signed-off-by: Meng Yan <myan@redhat.com>
Copy link
Copy Markdown
Contributor

@clyang82 clyang82 left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clyang82, yanmxa

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

The pull request process is described here

Details 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

@openshift-merge-bot openshift-merge-bot Bot merged commit b8b88a3 into stolostron:main Jan 27, 2026
15 checks passed
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants