mirror of https://code.forgejo.org/forgejo/runner
fix: make container.docker_host default to - (part two)
If --config is not specified, the default must also be "-" and not ""pull/333/head
parent
a3e575f61b
commit
b33e155709
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## 5.0.0
|
## 5.0.0
|
||||||
|
|
||||||
|
* Breaking change: the default configuration for `docker_host` is changed to [not mounting the docker server socket](https://code.forgejo.org/forgejo/runner/pulls/305) even when no configuration file is provided.
|
||||||
* [Add job_level logging option to config](https://code.forgejo.org/forgejo/runner/pulls/299) to make the logging level of jobs configurable. Change default from "trace" to "info".
|
* [Add job_level logging option to config](https://code.forgejo.org/forgejo/runner/pulls/299) to make the logging level of jobs configurable. Change default from "trace" to "info".
|
||||||
* [Don't log job output when debug logging is not enabled](https://code.forgejo.org/forgejo/runner/pulls/303). This reduces the default amount of log output of the runner.
|
* [Don't log job output when debug logging is not enabled](https://code.forgejo.org/forgejo/runner/pulls/303). This reduces the default amount of log output of the runner.
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,10 @@ func LoadDefault(file string) (*Config, error) {
|
||||||
cfg.Runner.ReportInterval = time.Second
|
cfg.Runner.ReportInterval = time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.Container.DockerHost == "" {
|
||||||
|
cfg.Container.DockerHost = "-"
|
||||||
|
}
|
||||||
|
|
||||||
// although `container.network_mode` will be deprecated, but we have to be compatible with it for now.
|
// although `container.network_mode` will be deprecated, but we have to be compatible with it for now.
|
||||||
if cfg.Container.NetworkMode != "" && cfg.Container.Network == "" {
|
if cfg.Container.NetworkMode != "" && cfg.Container.Network == "" {
|
||||||
log.Warn("You are trying to use deprecated configuration item of `container.network_mode`, please use `container.network` instead.")
|
log.Warn("You are trying to use deprecated configuration item of `container.network_mode`, please use `container.network` instead.")
|
||||||
|
|
|
@ -40,5 +40,6 @@ func TestDefaultSettings(t *testing.T) {
|
||||||
config, err := LoadDefault("")
|
config, err := LoadDefault("")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
assert.EqualValues(t, config.Container.DockerHost, "-")
|
||||||
assert.EqualValues(t, config.Log.JobLevel, "info")
|
assert.EqualValues(t, config.Log.JobLevel, "info")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue