mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-26 08:37:52 +02:00
Config for container network (#96)
Fix #66 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/96 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -36,3 +36,7 @@ cache:
|
||||
# The port of the cache server.
|
||||
# 0 means to use a random available port.
|
||||
port: 0
|
||||
|
||||
container:
|
||||
# Which network to use for the job containers.
|
||||
network: bridge
|
||||
|
@ -31,6 +31,9 @@ type Config struct {
|
||||
Host string `yaml:"host"`
|
||||
Port uint16 `yaml:"port"`
|
||||
} `yaml:"cache"`
|
||||
Container struct {
|
||||
Network string `yaml:"network"`
|
||||
}
|
||||
}
|
||||
|
||||
// LoadDefault returns the default configuration.
|
||||
@ -84,6 +87,9 @@ func LoadDefault(file string) (*Config, error) {
|
||||
cfg.Cache.Dir = filepath.Join(home, ".cache", "actcache")
|
||||
}
|
||||
}
|
||||
if cfg.Container.Network == "" {
|
||||
cfg.Container.Network = "bridge"
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user