Merge pull request #9461 from kinvolk/rata/idmap

pkg/process: Check using idmap mount options too
This commit is contained in:
Fu Wei
2023-12-05 15:43:14 +00:00
committed by GitHub

View File

@@ -206,6 +206,10 @@ func (p *Init) validateIDMapMounts(ctx context.Context, spec *specs.Spec) error
used = true
break
}
if sliceContainsStr(m.Options, "idmap") || sliceContainsStr(m.Options, "ridmap") {
used = true
break
}
}
if !used {
@@ -552,3 +556,12 @@ func withConditionalIO(c stdio.Stdio) runc.IOOpt {
o.OpenStderr = c.Stderr != ""
}
}
func sliceContainsStr(s []string, str string) bool {
for _, s := range s {
if s == str {
return true
}
}
return false
}