-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove '/' as a safe char from datasource name quote function call
Closes: #125
- Loading branch information
Showing
4 changed files
with
63 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- Fix issue with datasource names that could not contain slashes (#125) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/integration/targets/grafana_datasource/tasks/issues.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
|
||
- name: test datasource name with slash | ||
register: result | ||
grafana_datasource: | ||
name: "datasource/elastic" | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
org_id: '1' | ||
ds_type: elasticsearch | ||
ds_url: https://elastic.company.com:9200 | ||
database: '[logstash_]YYYY.MM.DD' | ||
basic_auth_user: grafana | ||
basic_auth_password: '******' | ||
time_field: '@timestamp' | ||
time_interval: 1m | ||
interval: Daily | ||
es_version: 56 | ||
max_concurrent_shard_requests: 42 | ||
tls_ca_cert: /etc/ssl/certs/ca.pem | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
- result.datasource.basicAuth | ||
- result.datasource.basicAuthUser == 'grafana' | ||
- result.datasource.access == 'proxy' | ||
- result.datasource.database == '[logstash_]YYYY.MM.DD' | ||
- not result.datasource.isDefault | ||
- result.datasource.jsonData.esVersion == 56 | ||
- result.datasource.jsonData.interval == 'Daily' | ||
- result.datasource.jsonData.maxConcurrentShardRequests == 42 | ||
- result.datasource.jsonData.timeField == '@timestamp' | ||
- not result.datasource.jsonData.tlsAuth | ||
- not result.datasource.jsonData.tlsAuthWithCACert | ||
- result.datasource.name == 'datasource/elastic' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.password == '' | ||
- result.datasource.type == 'elasticsearch' | ||
- result.datasource.url == 'https://elastic.company.com:9200' | ||
- result.datasource.user == '' | ||
- not result.datasource.withCredentials | ||
- "result.msg == 'Datasource datasource/elastic created'" | ||
|
||
... |