(config *configs.Config)
| 19 | type check func(config *configs.Config) error |
| 20 | |
| 21 | func Validate(config *configs.Config) error { |
| 22 | checks := []check{ |
| 23 | cgroupsCheck, |
| 24 | rootfs, |
| 25 | network, |
| 26 | netdevices, |
| 27 | uts, |
| 28 | security, |
| 29 | namespaces, |
| 30 | sysctl, |
| 31 | intelrdtCheck, |
| 32 | rootlessEUIDCheck, |
| 33 | mountsStrict, |
| 34 | scheduler, |
| 35 | ioPriority, |
| 36 | memoryPolicy, |
| 37 | } |
| 38 | for _, c := range checks { |
| 39 | if err := c(config); err != nil { |
| 40 | return err |
| 41 | } |
| 42 | } |
| 43 | // Relaxed validation rules for backward compatibility |
| 44 | warns := []check{ |
| 45 | mountsWarn, |
| 46 | } |
| 47 | for _, c := range warns { |
| 48 | if err := c(config); err != nil { |
| 49 | logrus.WithError(err).Warn("configuration") |
| 50 | } |
| 51 | } |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | // rootfs validates if the rootfs is an absolute path and is not a symlink |
| 56 | // to the container's root filesystem. |
no outgoing calls
searching dependent graphs…