ar: initialize allocwatcher on restore
Fixes a panic. Left a comment on how the behavior could be improved, but this is what releases <0.9.0 did.
This commit is contained in:
parent
5d71e880a4
commit
b7a9d61a38
|
@ -760,6 +760,11 @@ func (c *Client) restoreState() error {
|
|||
var mErr multierror.Error
|
||||
for _, alloc := range allocs {
|
||||
|
||||
//XXX On Restore we give up on watching previous allocs because
|
||||
// we need the local AllocRunners initialized first. We could
|
||||
// add a second loop to initialize just the alloc watcher.
|
||||
prevAllocWatcher := allocwatcher.NoopPrevAlloc{}
|
||||
|
||||
c.configLock.RLock()
|
||||
arConf := &allocrunner.Config{
|
||||
Alloc: alloc,
|
||||
|
@ -769,6 +774,7 @@ func (c *Client) restoreState() error {
|
|||
StateUpdater: c,
|
||||
Consul: c.consulService,
|
||||
Vault: c.vaultClient,
|
||||
PrevAllocWatcher: prevAllocWatcher,
|
||||
PluginLoader: c.config.PluginLoader,
|
||||
PluginSingletonLoader: c.config.PluginSingletonLoader,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue