mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: allow specified docker networks in functions (#982)
* fn: allow specified docker networks in functions If FN_DOCKER_NETWORK is specified with a list of networks, then agent driver picks the least used network to place functions on. * add mutex comment
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
type AgentConfig struct {
|
||||
MinDockerVersion string `json:"min_docker_version"`
|
||||
DockerNetworks string `json:"docker_networks"`
|
||||
FreezeIdle time.Duration `json:"freeze_idle_msecs"`
|
||||
EjectIdle time.Duration `json:"eject_idle_msecs"`
|
||||
HotPoll time.Duration `json:"hot_poll_msecs"`
|
||||
@@ -31,6 +32,7 @@ type AgentConfig struct {
|
||||
}
|
||||
|
||||
const (
|
||||
EnvDockerNetworks = "FN_DOCKER_NETWORKS"
|
||||
EnvFreezeIdle = "FN_FREEZE_IDLE_MSECS"
|
||||
EnvEjectIdle = "FN_EJECT_IDLE_MSECS"
|
||||
EnvHotPoll = "FN_HOT_POLL_MSECS"
|
||||
@@ -82,6 +84,7 @@ func NewAgentConfig() (*AgentConfig, error) {
|
||||
err = setEnvStr(err, EnvPreForkCmd, &cfg.PreForkCmd)
|
||||
err = setEnvUint(err, EnvPreForkUseOnce, &cfg.PreForkUseOnce)
|
||||
err = setEnvStr(err, EnvPreForkNetworks, &cfg.PreForkNetworks)
|
||||
err = setEnvStr(err, EnvDockerNetworks, &cfg.DockerNetworks)
|
||||
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
|
||||
Reference in New Issue
Block a user