mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-30 01:50:38 +00:00
Fix compile and unit test errors after merge
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -404,7 +404,6 @@ func populateCommand(c *Container) {
|
||||
User: c.Config.User,
|
||||
Config: driverConfig,
|
||||
Resources: resources,
|
||||
Context: c.Config.Context,
|
||||
}
|
||||
c.command.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ lxc.pts = 1024
|
||||
|
||||
# disable the main console
|
||||
lxc.console = none
|
||||
{{if getProcessLabel .Context}}
|
||||
lxc.se_context = {{ getProcessLabel .Context}}
|
||||
{{$MOUNTLABEL := getMountLabel .Context}}
|
||||
{{if getProcessLabel .Config}}
|
||||
lxc.se_context = {{ getProcessLabel .Config}}
|
||||
{{$MOUNTLABEL := getMountLabel .Config}}
|
||||
{{end}}
|
||||
|
||||
# no controlling tty at all
|
||||
@@ -147,12 +147,23 @@ func getMemorySwap(v *execdriver.Resources) int64 {
|
||||
return v.Memory * 2
|
||||
}
|
||||
|
||||
func getProcessLabel(c execdriver.Context) string {
|
||||
return c["process_label"]
|
||||
func getProcessLabel(c map[string][]string) string {
|
||||
return getLabel(c, "process")
|
||||
}
|
||||
|
||||
func getMountLabel(c execdriver.Context) string {
|
||||
return c["mount_label"]
|
||||
func getMountLabel(c map[string][]string) string {
|
||||
return getLabel(c, "mount")
|
||||
}
|
||||
|
||||
func getLabel(c map[string][]string, name string) string {
|
||||
label := c["label"]
|
||||
for _, l := range label {
|
||||
parts := strings.SplitN(l, "=", 2)
|
||||
if parts[0] == name {
|
||||
return parts[1]
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -2,13 +2,14 @@ package runtime
|
||||
|
||||
import (
|
||||
"github.com/dotcloud/docker/runconfig"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMergeLxcConfig(t *testing.T) {
|
||||
var (
|
||||
hostConfig = &runconfig.HostConfig{
|
||||
LxcConf: []runconfig.KeyValuePair{
|
||||
LxcConf: []utils.KeyValuePair{
|
||||
{Key: "lxc.cgroups.cpuset", Value: "1,2"},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user