mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
pluginmanager: WaitForFirstFingerprint times out (#9597)
As pointed out by @tgross[1], prior to this change we would have been blocking until all managers waited for first fingerprint rather than timing out as intended. 1: https://github.com/hashicorp/nomad/pull/9590#discussion_r539534906
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
package pluginmanager
|
||||
|
||||
import "context"
|
||||
|
||||
type MockPluginManager struct {
|
||||
RunF func()
|
||||
ShutdownF func()
|
||||
RunF func()
|
||||
ShutdownF func()
|
||||
WaitForFirstFingerprintCh <-chan struct{}
|
||||
}
|
||||
|
||||
func (m *MockPluginManager) Run() { m.RunF() }
|
||||
func (m *MockPluginManager) Shutdown() { m.ShutdownF() }
|
||||
func (m *MockPluginManager) PluginType() string { return "mock" }
|
||||
func (m *MockPluginManager) WaitForFirstFingerprint(ctx context.Context) <-chan struct{} {
|
||||
if m.WaitForFirstFingerprintCh != nil {
|
||||
return m.WaitForFirstFingerprintCh
|
||||
}
|
||||
|
||||
ch := make(chan struct{})
|
||||
close(ch)
|
||||
return ch
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user