mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 02:10:45 -06:00
provisioing: always skip sample.yaml files
This commit is contained in:
parent
165304a342
commit
dba087463a
@ -1,3 +1,6 @@
|
|||||||
|
# This file is only an example.
|
||||||
|
# Grafana will never read sample.yaml files
|
||||||
|
|
||||||
# # config file version
|
# # config file version
|
||||||
# apiVersion: 1
|
# apiVersion: 1
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# This file is only an example.
|
||||||
|
# Grafana will never read sample.yaml files
|
||||||
|
|
||||||
# # config file version
|
# # config file version
|
||||||
# apiVersion: 1
|
# apiVersion: 1
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ func (cr *configReader) readConfig() ([]*DashboardsAsConfig, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if !strings.HasSuffix(file.Name(), ".yaml") && !strings.HasSuffix(file.Name(), ".yml") {
|
if (!strings.HasSuffix(file.Name(), ".yaml") && !strings.HasSuffix(file.Name(), ".yml")) || file.Name() == "sample.yaml" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
providers:
|
||||||
|
- name: 'gasdf'
|
||||||
|
orgId: 2
|
||||||
|
folder: 'developers'
|
||||||
|
editable: true
|
||||||
|
type: file
|
||||||
|
options:
|
||||||
|
path: /var/lib/grafana/dashboards
|
@ -24,7 +24,7 @@ func (cr *configReader) readConfig(path string) ([]*DatasourcesAsConfig, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if strings.HasSuffix(file.Name(), ".yaml") || strings.HasSuffix(file.Name(), ".yml") {
|
if (strings.HasSuffix(file.Name(), ".yaml") || strings.HasSuffix(file.Name(), ".yml")) && file.Name() != "sample.yaml" {
|
||||||
datasource, err := cr.parseDatasourceConfig(path, file)
|
datasource, err := cr.parseDatasourceConfig(path, file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
# Should not be included
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
datasources:
|
||||||
|
- name: name
|
||||||
|
type: type
|
||||||
|
access: proxy
|
||||||
|
orgId: 2
|
||||||
|
url: url
|
||||||
|
password: password
|
||||||
|
user: user
|
||||||
|
database: database
|
||||||
|
basicAuth: true
|
||||||
|
basicAuthUser: basic_auth_user
|
||||||
|
basicAuthPassword: basic_auth_password
|
||||||
|
withCredentials: true
|
||||||
|
jsonData:
|
||||||
|
graphiteVersion: "1.1"
|
||||||
|
tlsAuth: true
|
||||||
|
tlsAuthWithCACert: true
|
||||||
|
secureJsonData:
|
||||||
|
tlsCACert: "MjNOcW9RdkbUDHZmpco2HCYzVq9dE+i6Yi+gmUJotq5CDA=="
|
||||||
|
tlsClientCert: "ckN0dGlyMXN503YNfjTcf9CV+GGQneN+xmAclQ=="
|
||||||
|
tlsClientKey: "ZkN4aG1aNkja/gKAB1wlnKFIsy2SRDq4slrM0A=="
|
||||||
|
editable: true
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
deleteDatasources:
|
||||||
|
- name: old-graphite3
|
||||||
|
orgId: 2
|
Loading…
Reference in New Issue
Block a user