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
c8382ba4
Commit
c8382ba4
authored
Jun 04, 2019
by
Augustin Husson
Committed by
Carl Bergquist
Jun 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provisioning: Support folder that doesn't exist yet in dashboard provisioning (#17407)
closes #17320
parent
87760d4f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
pkg/services/provisioning/dashboards/dashboard.go
+8
-2
pkg/services/provisioning/dashboards/file_reader.go
+0
-2
No files found.
pkg/services/provisioning/dashboards/dashboard.go
View file @
c8382ba4
...
...
@@ -3,6 +3,7 @@ package dashboards
import
(
"context"
"fmt"
"os"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/util/errutil"
...
...
@@ -38,8 +39,13 @@ func NewDashboardProvisionerImpl(configDirectory string) (*DashboardProvisionerI
func
(
provider
*
DashboardProvisionerImpl
)
Provision
()
error
{
for
_
,
reader
:=
range
provider
.
fileReaders
{
err
:=
reader
.
startWalkingDisk
()
if
err
!=
nil
{
if
err
:=
reader
.
startWalkingDisk
();
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
// don't stop the provisioning service in case the folder is missing. The folder can appear after the startup
provider
.
log
.
Warn
(
"Failed to provision config"
,
"name"
,
reader
.
Cfg
.
Name
,
"error"
,
err
)
return
nil
}
return
errutil
.
Wrapf
(
err
,
"Failed to provision config %v"
,
reader
.
Cfg
.
Name
)
}
}
...
...
pkg/services/provisioning/dashboards/file_reader.go
View file @
c8382ba4
...
...
@@ -72,10 +72,8 @@ func (fr *fileReader) startWalkingDisk() error {
fr
.
log
.
Debug
(
"Start walking disk"
,
"path"
,
fr
.
Path
)
resolvedPath
:=
fr
.
resolvedPath
()
if
_
,
err
:=
os
.
Stat
(
resolvedPath
);
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
return
err
}
}
folderId
,
err
:=
getOrCreateFolderId
(
fr
.
Cfg
,
fr
.
dashboardProvisioningService
)
if
err
!=
nil
&&
err
!=
ErrFolderNameMissing
{
...
...
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