Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
8fb9d250
Commit
8fb9d250
authored
6 years ago
by
Mahmood Ali
Browse files
Options
Download
Email Patches
Plain Diff
comment on use of init() for plugin handlers
parent
eeaa95dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/logmon/z_logmon_cmd.go
+5
-0
client/logmon/z_logmon_cmd.go
drivers/docker/docklog/z_docker_logger_cmd.go
+5
-0
drivers/docker/docklog/z_docker_logger_cmd.go
drivers/shared/executor/z_executor_cmd.go
+5
-0
drivers/shared/executor/z_executor_cmd.go
with
15 additions
and
0 deletions
+15
-0
client/logmon/z_logmon_cmd.go
+
5
-
0
View file @
8fb9d250
...
...
@@ -8,6 +8,11 @@ import (
"github.com/hashicorp/nomad/plugins/base"
)
// Install a plugin cli handler to ease working with tests
// and external plugins.
// This init() must be initialized last in package required by the child plugin
// process. It's recommended to avoid any other `init()` or inline any necessary calls
// here. See eeaa95d commit message for more details.
func
init
()
{
if
len
(
os
.
Args
)
>
1
&&
os
.
Args
[
1
]
==
"logmon"
{
logger
:=
hclog
.
New
(
&
hclog
.
LoggerOptions
{
...
...
This diff is collapsed.
Click to expand it.
drivers/docker/docklog/z_docker_logger_cmd.go
+
5
-
0
View file @
8fb9d250
...
...
@@ -8,6 +8,11 @@ import (
"github.com/hashicorp/nomad/plugins/base"
)
// Install a plugin cli handler to ease working with tests
// and external plugins.
// This init() must be initialized last in package required by the child plugin
// process. It's recommended to avoid any other `init()` or inline any necessary calls
// here. See eeaa95d commit message for more details.
func
init
()
{
if
len
(
os
.
Args
)
>
1
&&
os
.
Args
[
1
]
==
PluginName
{
logger
:=
log
.
New
(
&
log
.
LoggerOptions
{
...
...
This diff is collapsed.
Click to expand it.
drivers/shared/executor/z_executor_cmd.go
+
5
-
0
View file @
8fb9d250
...
...
@@ -11,6 +11,11 @@ import (
"github.com/hashicorp/nomad/plugins/base"
)
// Install a plugin cli handler to ease working with tests
// and external plugins.
// This init() must be initialized last in package required by the child plugin
// process. It's recommended to avoid any other `init()` or inline any necessary calls
// here. See eeaa95d commit message for more details.
func
init
()
{
if
len
(
os
.
Args
)
>
1
&&
os
.
Args
[
1
]
==
"executor"
{
if
len
(
os
.
Args
)
!=
3
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help