Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validator: Relax warning for not abs mount dst path #4013

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libcontainer/configs/validate/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading