Skip to content

Commit

Permalink
runtimetest: Make validateRlimits silent on Windows
Browse files Browse the repository at this point in the history
This isn't a question of not being implemented yet.  Windows does not,
and is unlikely to ever, support rlimits [1].  And the spec only
defines process.rlimits for POSIX platforms [2].  Folks writing
Windows configs will only be setting process.rlimits as an out-of-spec
extention.  We, as runtime validators, are unlikely to write such
configs.  But if we use runtimetest in a container launched from such
a config, we should silently ignore that out-of-spec extention, just
like we silently ignore all other out-of-spec extentions, instead of
logging a warning.

[1]: opencontainers/runtime-spec#835 (comment)
[2]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config.md#posix-process

Signed-off-by: W. Trevor King <[email protected]>
  • Loading branch information
wking committed Nov 3, 2017
1 parent 502b569 commit 95e0d95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/runtimetest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,11 @@ func validateHostname(spec *rspec.Spec) error {
}

func validateRlimits(spec *rspec.Spec) error {
if spec.Process == nil {
if runtime.GOOS == "windows" {
return nil
}

if runtime.GOOS != "linux" && runtime.GOOS != "solaris" {
logrus.Warnf("process.rlimits validation not yet implemented for OS %q", runtime.GOOS)
if spec.Process == nil {
return nil
}

Expand Down

0 comments on commit 95e0d95

Please sign in to comment.