From 95e0d9583213af7e892026cdc6ba1213123fad06 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 2 Nov 2017 21:33:18 -0700 Subject: [PATCH] runtimetest: Make validateRlimits silent on Windows 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]: https://github.com/opencontainers/runtime-spec/pull/835#issuecomment-303455386 [2]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config.md#posix-process Signed-off-by: W. Trevor King --- cmd/runtimetest/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/runtimetest/main.go b/cmd/runtimetest/main.go index c6988986e..5e38e44f7 100644 --- a/cmd/runtimetest/main.go +++ b/cmd/runtimetest/main.go @@ -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 }