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
a0137821
Commit
a0137821
authored
7 years ago
by
Alex Dadgar
Browse files
Options
Download
Email Patches
Plain Diff
Pull in new autopilot
parent
ebfd203a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vendor/github.com/hashicorp/consul/agent/consul/autopilot/autopilot.go
+20
-0
....com/hashicorp/consul/agent/consul/autopilot/autopilot.go
vendor/vendor.json
+1
-1
vendor/vendor.json
with
21 additions
and
1 deletion
+21
-1
vendor/github.com/hashicorp/consul/agent/consul/autopilot/autopilot.go
+
20
-
0
View file @
a0137821
...
...
@@ -38,8 +38,10 @@ type Autopilot struct {
clusterHealth
OperatorHealthReply
clusterHealthLock
sync
.
RWMutex
enabled
bool
removeDeadCh
chan
struct
{}
shutdownCh
chan
struct
{}
shutdownLock
sync
.
Mutex
waitGroup
sync
.
WaitGroup
}
...
...
@@ -62,6 +64,14 @@ func NewAutopilot(logger *log.Logger, delegate Delegate, interval, healthInterva
}
func
(
a
*
Autopilot
)
Start
()
{
a
.
shutdownLock
.
Lock
()
defer
a
.
shutdownLock
.
Unlock
()
// Nothing to do
if
a
.
enabled
{
return
}
a
.
shutdownCh
=
make
(
chan
struct
{})
a
.
waitGroup
=
sync
.
WaitGroup
{}
a
.
clusterHealth
=
OperatorHealthReply
{}
...
...
@@ -69,11 +79,21 @@ func (a *Autopilot) Start() {
a
.
waitGroup
.
Add
(
2
)
go
a
.
run
()
go
a
.
serverHealthLoop
()
a
.
enabled
=
true
}
func
(
a
*
Autopilot
)
Stop
()
{
a
.
shutdownLock
.
Lock
()
defer
a
.
shutdownLock
.
Unlock
()
// Nothing to do
if
!
a
.
enabled
{
return
}
close
(
a
.
shutdownCh
)
a
.
waitGroup
.
Wait
()
a
.
enabled
=
false
}
// run periodically looks for nonvoting servers to promote and dead servers to remove.
...
...
This diff is collapsed.
Click to expand it.
vendor/vendor.json
+
1
-
1
View file @
a0137821
...
...
@@ -123,7 +123,7 @@
{
"path"
:
"github.com/hashicorp/consul-template/template"
,
"checksumSHA1"
:
"N9qobVzScLbTEnGE7MgFnnTbGBw="
,
"revision"
:
"26d029ad37335b3827a9fde5569b2c5e10dcac8f"
,
"revisionTime"
:
"2017-10-31T14:25:17Z"
},
{
"path"
:
"github.com/hashicorp/consul-template/version"
,
"checksumSHA1"
:
"NB5+D4AuCNV9Bsqh3YFdPi4AJ6U="
,
"revision"
:
"26d029ad37335b3827a9fde5569b2c5e10dcac8f"
,
"revisionTime"
:
"2017-10-31T14:25:17Z"
},
{
"path"
:
"github.com/hashicorp/consul-template/watch"
,
"checksumSHA1"
:
"b4+Y+02pY2Y5620F9ALzKg8Zmdw="
,
"revision"
:
"26d029ad37335b3827a9fde5569b2c5e10dcac8f"
,
"revisionTime"
:
"2017-10-31T14:25:17Z"
},
{
"path"
:
"github.com/hashicorp/consul/agent/consul/autopilot"
,
"checksumSHA1"
:
"
/nyemJLkxBXKqI9xpLFyTyvOaYY="
,
"revision"
:
"bfeb09983befa337a3b2ebbafb7567913773e40b
"
,
"revisionTime"
:
"2018-0
1
-2
3T20:52:17
Z"
},
{
"path"
:
"github.com/hashicorp/consul/agent/consul/autopilot"
,
"checksumSHA1"
:
"
+I7fgoQlrnTUGW5krqNLadWwtjg="
,
"revision"
:
"d1ede2c93dec7b4580e37ef41d24371abab9d9e9
"
,
"revisionTime"
:
"2018-0
2
-2
1T18:19:48
Z"
},
{
"path"
:
"github.com/hashicorp/consul/api"
,
"checksumSHA1"
:
"XLfcIX2qpRr0o26aFMjCOzvw6jo="
,
"revision"
:
"51ea240df8476e02215d53fbfad5838bf0d44d21"
,
"revisionTime"
:
"2017-10-16T16:22:40Z"
},
{
"path"
:
"github.com/hashicorp/consul/command/flags"
,
"checksumSHA1"
:
"XTQIYV+DPUVRKpVp0+y/78bWH3I="
,
"revision"
:
"d08ab9fd199434e5220276356ecf9617cfec1eb2"
,
"revisionTime"
:
"2017-12-18T20:26:35Z"
},
{
"path"
:
"github.com/hashicorp/consul/lib"
,
"checksumSHA1"
:
"HGljdtVaqi/e3DgIHymLRLfPYhw="
,
"revision"
:
"bcafded4e60982d0b71e730f0b8564d73cb1d715"
,
"revisionTime"
:
"2017-10-31T16:39:15Z"
},
...
...
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