Skip to content

Commit b17c6f2

Browse files
committed
validator: Relax warning for not abs mount dst path
The runtime spec now allows relative mount dst paths, so remove the comment saying we will switch this to an error later and change the error messages to reflect that. Signed-off-by: Rodrigo Campos <[email protected]>
1 parent e897a16 commit b17c6f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libcontainer/configs/validate/validator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ func Validate(config *configs.Config) error {
3838
}
3939
// Relaxed validation rules for backward compatibility
4040
warns := []check{
41-
mounts, // TODO (runc v1.x.x): make this an error instead of a warning
41+
mountsWarn,
4242
}
4343
for _, c := range warns {
4444
if err := c(config); err != nil {
45-
logrus.WithError(err).Warn("invalid configuration")
45+
logrus.WithError(err).Warn("configuration")
4646
}
4747
}
4848
return nil
@@ -300,10 +300,10 @@ func checkIDMapMounts(config *configs.Config, m *configs.Mount) error {
300300
return nil
301301
}
302302

303-
func mounts(config *configs.Config) error {
303+
func mountsWarn(config *configs.Config) error {
304304
for _, m := range config.Mounts {
305305
if !filepath.IsAbs(m.Destination) {
306-
return fmt.Errorf("invalid mount %+v: mount destination not absolute", m)
306+
return fmt.Errorf("mount %+v: relative destination path is **deprecated**, using it as relative to /", m)
307307
}
308308
}
309309
return nil

0 commit comments

Comments
 (0)