Set AgentShutdown

This commit is contained in:
Mahmood Ali
2020-07-17 11:04:57 -04:00
parent c5b2895b0b
commit c7828c1f7c
2 changed files with 5 additions and 0 deletions

View File

@@ -430,6 +430,7 @@ func (a *Agent) finalizeServerConfig(c *nomad.Config) {
// Setup the plugin loaders
c.PluginLoader = a.pluginLoader
c.PluginSingletonLoader = a.pluginSingletonLoader
c.AgentShutdown = func() error { return a.Shutdown() }
}
// clientConfig is used to generate a new client configuration struct for

View File

@@ -351,6 +351,10 @@ type Config struct {
// LicenseConfig is a tunable knob for enterprise license testing.
LicenseConfig *LicenseConfig
// AgentShutdown is used to call agent.Shutdown from the context of a Server
// It is used primarily for licensing
AgentShutdown func() error
}
// CheckVersion is used to check if the ProtocolVersion is valid