MCPcopy
hub / github.com/opencontainers/runc / Validate

Function Validate

libcontainer/configs/validate/validator.go:21–53  ·  view source on GitHub ↗
(config *configs.Config)

Source from the content-addressed store, hash-verified

19type check func(config *configs.Config) error
20
21func 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.

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…