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
2d95f060
Unverified
Commit
2d95f060
authored
3 years ago
by
Karan Sharma
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
feat: Warn if bootstrap_expect is even number (#12961)
parent
eafc9390
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
command/agent/command.go
+3
-0
command/agent/command.go
command/agent/command_test.go
+4
-0
command/agent/command_test.go
with
7 additions
and
0 deletions
+7
-0
command/agent/command.go
+
3
-
0
View file @
2d95f060
...
...
@@ -436,6 +436,9 @@ func (c *Command) IsValidConfig(config, cmdConfig *Config) bool {
if
config
.
Server
.
Enabled
&&
config
.
Server
.
BootstrapExpect
==
1
{
c
.
Ui
.
Error
(
"WARNING: Bootstrap mode enabled! Potentially unsafe operation."
)
}
if
config
.
Server
.
Enabled
&&
config
.
Server
.
BootstrapExpect
%
2
==
0
{
c
.
Ui
.
Error
(
"WARNING: Number of bootstrap servers should ideally be set to an odd number."
)
}
}
// ProtocolVersion has never been used. Warn if it is set as someone
...
...
This diff is collapsed.
Click to expand it.
command/agent/command_test.go
+
4
-
0
View file @
2d95f060
...
...
@@ -44,6 +44,10 @@ func TestCommand_Args(t *testing.T) {
[]
string
{
"-data-dir="
+
tmpDir
,
"-server"
,
"-bootstrap-expect=1"
},
"WARNING: Bootstrap mode enabled!"
,
},
{
[]
string
{
"-data-dir="
+
tmpDir
,
"-server"
,
"-bootstrap-expect=2"
},
"Number of bootstrap servers should ideally be set to an odd number"
,
},
{
[]
string
{
"-server"
},
"Must specify
\"
data_dir
\"
config option or
\"
data-dir
\"
CLI flag"
,
...
...
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