mirror of
https://github.com/rancher/rke.git
synced 2025-08-10 11:13:44 +00:00
Apply MCS label when privileged is false
This commit is contained in:
parent
798632b3a4
commit
32bf922fc5
@ -122,6 +122,8 @@ func GetProcessConfig(process v3.Process, host *hosts.Host) (*container.Config,
|
||||
if len(process.RestartPolicy) > 0 {
|
||||
hostCfg.RestartPolicy = container.RestartPolicy{Name: process.RestartPolicy}
|
||||
}
|
||||
// The MCS label only needs to be applied when container is not running privileged, and running privileged negates need for applying the label
|
||||
if !process.Privileged {
|
||||
for _, securityOpt := range host.DockerInfo.SecurityOptions {
|
||||
// If Docker is configured with selinux-enabled:true, we need to specify MCS label to allow files from service-sidekick to be shared between containers
|
||||
if securityOpt == "selinux" {
|
||||
@ -142,6 +144,7 @@ func GetProcessConfig(process v3.Process, host *hosts.Host) (*container.Config,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return imageCfg, hostCfg, process.HealthCheck.URL
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user