mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user