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
165304a3
Commit
165304a3
authored
Feb 14, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioning: handle nil configs
parent
3091697a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
pkg/services/provisioning/datasources/config_reader.go
+4
-0
pkg/services/provisioning/datasources/types.go
+8
-0
No files found.
pkg/services/provisioning/datasources/config_reader.go
View file @
165304a3
...
...
@@ -57,6 +57,10 @@ func (cr *configReader) parseDatasourceConfig(path string, file os.FileInfo) (*D
return
nil
,
err
}
if
apiVersion
==
nil
{
apiVersion
=
&
ConfigVersion
{
ApiVersion
:
0
}
}
if
apiVersion
.
ApiVersion
>
0
{
var
v1
*
DatasourcesAsConfigV1
err
=
yaml
.
Unmarshal
(
yamlFile
,
&
v1
)
...
...
pkg/services/provisioning/datasources/types.go
View file @
165304a3
...
...
@@ -111,6 +111,10 @@ func (cfg *DatasourcesAsConfigV1) mapToDatasourceFromConfig(apiVersion int64) *D
r
.
ApiVersion
=
apiVersion
if
cfg
==
nil
{
return
r
}
for
_
,
ds
:=
range
cfg
.
Datasources
{
r
.
Datasources
=
append
(
r
.
Datasources
,
&
DataSourceFromConfig
{
OrgId
:
ds
.
OrgId
,
...
...
@@ -148,6 +152,10 @@ func (cfg *DatasourcesAsConfigV0) mapToDatasourceFromConfig(apiVersion int64) *D
r
.
ApiVersion
=
apiVersion
if
cfg
==
nil
{
return
r
}
for
_
,
ds
:=
range
cfg
.
Datasources
{
r
.
Datasources
=
append
(
r
.
Datasources
,
&
DataSourceFromConfig
{
OrgId
:
ds
.
OrgId
,
...
...
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