mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #10370 from ashahab-altiscale/9875-apparmor-regression
Fixes apparmor regression
This commit is contained in:
commit
83bec40e86
2 changed files with 9 additions and 7 deletions
|
@ -75,8 +75,8 @@ lxc.aa_profile = unconfined
|
||||||
# In non-privileged mode, lxc will automatically mount /proc and /sys in readonly mode
|
# In non-privileged mode, lxc will automatically mount /proc and /sys in readonly mode
|
||||||
# for security. See: http://man7.org/linux/man-pages/man5/lxc.container.conf.5.html
|
# for security. See: http://man7.org/linux/man-pages/man5/lxc.container.conf.5.html
|
||||||
lxc.mount.auto = proc sys
|
lxc.mount.auto = proc sys
|
||||||
{{if .AppArmor}}
|
{{if .AppArmorProfile}}
|
||||||
lxc.aa_profile = .AppArmorProfile
|
lxc.aa_profile = {{.AppArmorProfile}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,8 @@ func TestCustomLxcConfigMisc(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(root)
|
defer os.RemoveAll(root)
|
||||||
os.MkdirAll(path.Join(root, "containers", "1"), 0777)
|
os.MkdirAll(path.Join(root, "containers", "1"), 0777)
|
||||||
driver, err := NewDriver(root, "", false)
|
driver, err := NewDriver(root, "", true)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -271,9 +272,10 @@ func TestCustomLxcConfigMisc(t *testing.T) {
|
||||||
Bridge: "docker0",
|
Bridge: "docker0",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ProcessConfig: processConfig,
|
ProcessConfig: processConfig,
|
||||||
CapAdd: []string{"net_admin", "syslog"},
|
CapAdd: []string{"net_admin", "syslog"},
|
||||||
CapDrop: []string{"kill", "mknod"},
|
CapDrop: []string{"kill", "mknod"},
|
||||||
|
AppArmorProfile: "lxc-container-default-with-nesting",
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := driver.generateLXCConfig(command)
|
p, err := driver.generateLXCConfig(command)
|
||||||
|
@ -287,7 +289,7 @@ func TestCustomLxcConfigMisc(t *testing.T) {
|
||||||
grepFile(t, p, "lxc.network.ipv4 = 10.10.10.10/24")
|
grepFile(t, p, "lxc.network.ipv4 = 10.10.10.10/24")
|
||||||
grepFile(t, p, "lxc.network.ipv4.gateway = 10.10.10.1")
|
grepFile(t, p, "lxc.network.ipv4.gateway = 10.10.10.1")
|
||||||
grepFile(t, p, "lxc.network.flags = up")
|
grepFile(t, p, "lxc.network.flags = up")
|
||||||
|
grepFile(t, p, "lxc.aa_profile = lxc-container-default-with-nesting")
|
||||||
// hostname
|
// hostname
|
||||||
grepFile(t, p, "lxc.utsname = testhost")
|
grepFile(t, p, "lxc.utsname = testhost")
|
||||||
grepFile(t, p, "lxc.cgroup.cpuset.cpus = 0,1")
|
grepFile(t, p, "lxc.cgroup.cpuset.cpus = 0,1")
|
||||||
|
|
Loading…
Add table
Reference in a new issue