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

lint.go: Handle variable template values #48

Merged
merged 1 commit into from
May 25, 2022
Merged

Conversation

bosc0
Copy link

@bosc0 bosc0 commented May 10, 2022

Since the merge of #45 the linter breaks on jsons like this:

          {
            "allValue": ".+",
            "current": { },
            "datasource": "$datasource",
            "hide": 0,
            "includeAll": true,
            "label": "job",
            "multi": true,
            "name": "job",
            "options": [ ],
            "query": "label_values(awx_system_info, job)",
            "refresh": 1,
            "regex": "",
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [ ],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
         },

It will return an error: Error: failed to parse dashboard: 'text' property required even though it is valid in grafana. The handling of "current": { }, is the part that causes the error, this PR fixes this behaviour.

Copy link
Collaborator

@rgeyer rgeyer left a comment

Choose a reason for hiding this comment

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

This is excellent, thank you! I actually encountered this as an issue while working on several mixins, so this saved me a lot of time :)

@rgeyer rgeyer merged commit 1e37927 into grafana:main May 25, 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.

None yet

2 participants