Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4dc6074e
Commit
4dc6074e
authored
Feb 20, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioning: dont ignore sample yaml files
closes #10963
parent
c5461fe2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
46 deletions
+51
-46
conf/provisioning/dashboards/sample.yaml
+1
-4
conf/provisioning/datasources/sample.yaml
+1
-4
pkg/services/provisioning/dashboards/config_reader.go
+1
-1
pkg/services/provisioning/dashboards/test-configs/dashboards-from-disk/sample.yaml
+8
-8
pkg/services/provisioning/datasources/config_reader.go
+1
-1
pkg/services/provisioning/datasources/config_reader_test.go
+12
-1
pkg/services/provisioning/datasources/test-configs/all-properties/sample.yaml
+27
-27
No files found.
conf/provisioning/dashboards/sample.yaml
View file @
4dc6074e
# This file is only an example.
# Grafana will never read sample.yaml files
# # config file version
#
apiVersion: 1
apiVersion
:
1
#providers:
# - name: 'default'
...
...
conf/provisioning/datasources/sample.yaml
View file @
4dc6074e
# This file is only an example.
# Grafana will never read sample.yaml files
# # config file version
#
apiVersion: 1
apiVersion
:
1
# # list of datasources that should be deleted from the database
#deleteDatasources:
...
...
pkg/services/provisioning/dashboards/config_reader.go
View file @
4dc6074e
...
...
@@ -63,7 +63,7 @@ func (cr *configReader) readConfig() ([]*DashboardsAsConfig, error) {
}
for
_
,
file
:=
range
files
{
if
(
!
strings
.
HasSuffix
(
file
.
Name
(),
".yaml"
)
&&
!
strings
.
HasSuffix
(
file
.
Name
(),
".yml"
))
||
file
.
Name
()
==
"sample.yaml"
{
if
!
strings
.
HasSuffix
(
file
.
Name
(),
".yaml"
)
&&
!
strings
.
HasSuffix
(
file
.
Name
(),
".yml"
)
{
continue
}
...
...
pkg/services/provisioning/dashboards/test-configs/dashboards-from-disk/sample.yaml
View file @
4dc6074e
apiVersion
:
1
providers
:
-
name
:
'
gasdf'
orgId
:
2
folder
:
'
developers'
editable
:
true
type
:
file
options
:
path
:
/var/lib/grafana/dashboards
#
providers:
#
- name: 'gasdf'
#
orgId: 2
#
folder: 'developers'
#
editable: true
#
type: file
#
options:
#
path: /var/lib/grafana/dashboards
pkg/services/provisioning/datasources/config_reader.go
View file @
4dc6074e
...
...
@@ -24,7 +24,7 @@ func (cr *configReader) readConfig(path string) ([]*DatasourcesAsConfig, error)
}
for
_
,
file
:=
range
files
{
if
(
strings
.
HasSuffix
(
file
.
Name
(),
".yaml"
)
||
strings
.
HasSuffix
(
file
.
Name
(),
".yml"
))
&&
file
.
Name
()
!=
"sample.yaml"
{
if
strings
.
HasSuffix
(
file
.
Name
(),
".yaml"
)
||
strings
.
HasSuffix
(
file
.
Name
(),
".yml"
)
{
datasource
,
err
:=
cr
.
parseDatasourceConfig
(
path
,
file
)
if
err
!=
nil
{
return
nil
,
err
...
...
pkg/services/provisioning/datasources/config_reader_test.go
View file @
4dc6074e
...
...
@@ -138,7 +138,7 @@ func TestDatasourceAsConfig(t *testing.T) {
t
.
Fatalf
(
"readConfig return an error %v"
,
err
)
}
So
(
len
(
cfg
),
ShouldEqual
,
2
)
So
(
len
(
cfg
),
ShouldEqual
,
3
)
dsCfg
:=
cfg
[
0
]
...
...
@@ -146,6 +146,17 @@ func TestDatasourceAsConfig(t *testing.T) {
validateDatasource
(
dsCfg
)
validateDeleteDatasources
(
dsCfg
)
dsCount
:=
0
delDsCount
:=
0
for
_
,
c
:=
range
cfg
{
dsCount
+=
len
(
c
.
Datasources
)
delDsCount
+=
len
(
c
.
DeleteDatasources
)
}
So
(
dsCount
,
ShouldEqual
,
2
)
So
(
delDsCount
,
ShouldEqual
,
1
)
})
Convey
(
"can read all properties from version 0"
,
func
()
{
...
...
pkg/services/provisioning/datasources/test-configs/all-properties/sample.yaml
View file @
4dc6074e
...
...
@@ -3,30 +3,30 @@
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
#
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment