mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 10:21:00 +00:00
add in validation for shm size, run go fmt on util.go
This commit is contained in:
parent
f478c8eeb6
commit
9d5e17ee92
2 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,7 @@ func toContainerConfig(c *yaml.Container) *dockerclient.ContainerConfig {
|
|||
Privileged: c.Privileged,
|
||||
NetworkMode: c.Network,
|
||||
Memory: c.MemLimit,
|
||||
ShmSize: c.ShmSize,
|
||||
ShmSize: c.ShmSize,
|
||||
CpuShares: c.CPUShares,
|
||||
CpuQuota: c.CPUQuota,
|
||||
CpusetCpus: c.CPUSet,
|
||||
|
|
|
@ -51,6 +51,9 @@ func CheckTrusted(c *yaml.Container) error {
|
|||
if c.Privileged {
|
||||
return fmt.Errorf("Insufficient privileges to use privileged mode")
|
||||
}
|
||||
if c.ShmSize != 0 {
|
||||
return fmt.Errorf("Insufficient privileges to override shm_size")
|
||||
}
|
||||
if len(c.DNS) != 0 {
|
||||
return fmt.Errorf("Insufficient privileges to use custom dns")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue