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
06972746
Commit
06972746
authored
Dec 05, 2015
by
woodsaj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I add plugin dependency check.
This check ensures that all of the plugins required by a bundle are loaded.
parent
523cf21b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
pkg/plugins/plugins.go
+21
-0
No files found.
pkg/plugins/plugins.go
View file @
06972746
...
...
@@ -35,9 +35,30 @@ func Init() error {
scan
(
path
.
Join
(
setting
.
StaticRootPath
,
"app/plugins"
))
checkExternalPluginPaths
()
checkDependencies
()
return
nil
}
func
checkDependencies
()
{
for
bundleType
,
bundle
:=
range
Bundles
{
for
_
,
reqPanel
:=
range
bundle
.
PanelPlugins
{
if
_
,
ok
:=
Panels
[
reqPanel
];
!
ok
{
log
.
Fatal
(
4
,
"Bundle %s requires Panel type %s, but it is not present."
,
bundleType
,
reqPanel
)
}
}
for
_
,
reqDataSource
:=
range
bundle
.
DatasourcePlugins
{
if
_
,
ok
:=
DataSources
[
reqDataSource
];
!
ok
{
log
.
Fatal
(
4
,
"Bundle %s requires DataSource type %s, but it is not present."
,
bundleType
,
reqDataSource
)
}
}
for
_
,
reqExtPlugin
:=
range
bundle
.
ExternalPlugins
{
if
_
,
ok
:=
ExternalPlugins
[
reqExtPlugin
];
!
ok
{
log
.
Fatal
(
4
,
"Bundle %s requires DataSource type %s, but it is not present."
,
bundleType
,
reqExtPlugin
)
}
}
}
}
func
checkExternalPluginPaths
()
error
{
for
_
,
section
:=
range
setting
.
Cfg
.
Sections
()
{
if
strings
.
HasPrefix
(
section
.
Name
(),
"plugin."
)
{
...
...
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