mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
client: add autofetch for CNI plugins
This commit is contained in:
@@ -437,6 +437,7 @@ func convertClientConfig(agentConfig *Config) (*clientconfig.Config, error) {
|
||||
if agentConfig.DataDir != "" {
|
||||
conf.StateDir = filepath.Join(agentConfig.DataDir, "client")
|
||||
conf.AllocDir = filepath.Join(agentConfig.DataDir, "alloc")
|
||||
conf.AutoFetchCNIDir = filepath.Join(agentConfig.DataDir, "cnibin")
|
||||
}
|
||||
if agentConfig.Client.StateDir != "" {
|
||||
conf.StateDir = agentConfig.Client.StateDir
|
||||
@@ -542,6 +543,8 @@ func convertClientConfig(agentConfig *Config) (*clientconfig.Config, error) {
|
||||
conf.CNIPath = agentConfig.Client.CNIPath
|
||||
conf.BridgeNetworkName = agentConfig.Client.BridgeNetworkName
|
||||
conf.BridgeNetworkAllocSubnet = agentConfig.Client.BridgeNetworkSubnet
|
||||
conf.AutoFetchCNI = agentConfig.Client.AutoFetchCNIPlugins
|
||||
conf.AutoFetchCNIURL = agentConfig.Client.AutoFetchCNIPluginsURL
|
||||
|
||||
return conf, nil
|
||||
}
|
||||
|
||||
@@ -260,6 +260,12 @@ type ClientConfig struct {
|
||||
// creating allocations with bridge networking mode. This range is local to
|
||||
// the host
|
||||
BridgeNetworkSubnet string `hcl:"bridge_network_subnet"`
|
||||
|
||||
// AutoFetchCNIPlugins
|
||||
AutoFetchCNIPlugins bool `hcl:"auto_fetch_cni_plugins`
|
||||
|
||||
// AutoFetchCNIPluginsURL
|
||||
AutoFetchCNIPluginsURL string `hcl:"auto_fetch_cni_plugins_url`
|
||||
}
|
||||
|
||||
// ACLConfig is configuration specific to the ACL system
|
||||
@@ -674,6 +680,7 @@ func DevConfig() *Config {
|
||||
conf.Telemetry.PrometheusMetrics = true
|
||||
conf.Telemetry.PublishAllocationMetrics = true
|
||||
conf.Telemetry.PublishNodeMetrics = true
|
||||
conf.Client.AutoFetchCNIPlugins = true
|
||||
|
||||
return conf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user