From b17c6f237dfd6d2dab9bd9c9b36cb9e429ee1fd1 Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Mon, 11 Sep 2023 15:57:14 +0200 Subject: [PATCH] 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 --- libcontainer/configs/validate/validator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcontainer/configs/validate/validator.go b/libcontainer/configs/validate/validator.go index 81eebba797f..11b80ddaae6 100644 --- a/libcontainer/configs/validate/validator.go +++ b/libcontainer/configs/validate/validator.go @@ -38,11 +38,11 @@ func Validate(config *configs.Config) error { } // Relaxed validation rules for backward compatibility warns := []check{ - mounts, // TODO (runc v1.x.x): make this an error instead of a warning + mountsWarn, } for _, c := range warns { if err := c(config); err != nil { - logrus.WithError(err).Warn("invalid configuration") + logrus.WithError(err).Warn("configuration") } } return nil @@ -300,10 +300,10 @@ func checkIDMapMounts(config *configs.Config, m *configs.Mount) error { return nil } -func mounts(config *configs.Config) error { +func mountsWarn(config *configs.Config) error { for _, m := range config.Mounts { if !filepath.IsAbs(m.Destination) { - return fmt.Errorf("invalid mount %+v: mount destination not absolute", m) + return fmt.Errorf("mount %+v: relative destination path is **deprecated**, using it as relative to /", m) } } return nil