From f86f5d3e59f2a319d8bfaaf5712dc90602f001a7 Mon Sep 17 00:00:00 2001
From: Matthew Heon <matthew.heon@gmail.com>
Date: Mon, 27 Aug 2018 14:58:04 -0400
Subject: Do not set max open files by default if we are rootless

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1355
Approved by: rhatdan
---
 pkg/spec/spec.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'pkg')

diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index a2fa169e5..6520940d0 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -458,7 +458,7 @@ func addRlimits(config *CreateConfig, g *generate.Generator) error {
 		g.AddProcessRlimits("RLIMIT_"+strings.ToUpper(ul.Name), uint64(ul.Hard), uint64(ul.Soft))
 	}
 
-	if !nofileSet {
+	if !nofileSet && !rootless.IsRootless() {
 		g.AddProcessRlimits("RLIMIT_NOFILE", 1048576, 1048576)
 	}
 
-- 
cgit v1.2.3-54-g00ecf