63a7ccdd23
Only modifies non-running containers resolv.conf bind mount, and only if the container has an unmodified resolv.conf compared to its contents at container start time (so we don't overwrite manual/automated changes within the container runtime). For containers which are running when the host resolv.conf changes, the update will only be applied to the container version of resolv.conf when the container is "bounced" down and back up (e.g. stop/start or restart) Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
26 lines
531 B
Go
26 lines
531 B
Go
package daemon
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/docker/runconfig"
|
|
"github.com/docker/docker/utils"
|
|
)
|
|
|
|
func TestMergeLxcConfig(t *testing.T) {
|
|
hostConfig := &runconfig.HostConfig{
|
|
LxcConf: []utils.KeyValuePair{
|
|
{Key: "lxc.cgroups.cpuset", Value: "1,2"},
|
|
},
|
|
}
|
|
|
|
out, err := mergeLxcConfIntoOptions(hostConfig)
|
|
if err != nil {
|
|
t.Fatalf("Failed to merge Lxc Config: %s", err)
|
|
}
|
|
|
|
cpuset := out[0]
|
|
if expected := "cgroups.cpuset=1,2"; cpuset != expected {
|
|
t.Fatalf("expected %s got %s", expected, cpuset)
|
|
}
|
|
}
|