From 137769a694136ef744fcb22ba389910fe1c1d951 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 28 Aug 2018 13:11:07 -0500 Subject: [PATCH] virtcontainers: apply devices constraints Apply devices constraints to the container in the virtual machine fixes #656 Signed-off-by: Julio Montes --- virtcontainers/kata_agent.go | 1 - virtcontainers/kata_agent_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/virtcontainers/kata_agent.go b/virtcontainers/kata_agent.go index 717acb3449..761155dca3 100644 --- a/virtcontainers/kata_agent.go +++ b/virtcontainers/kata_agent.go @@ -669,7 +669,6 @@ func constraintGRPCSpec(grpcSpec *grpc.Spec) { // By now only CPU constraints are supported // Issue: https://github.com/kata-containers/runtime/issues/158 // Issue: https://github.com/kata-containers/runtime/issues/204 - grpcSpec.Linux.Resources.Devices = nil grpcSpec.Linux.Resources.Pids = nil grpcSpec.Linux.Resources.BlockIO = nil grpcSpec.Linux.Resources.HugepageLimits = nil diff --git a/virtcontainers/kata_agent_test.go b/virtcontainers/kata_agent_test.go index e4892f7fc6..56532a3f34 100644 --- a/virtcontainers/kata_agent_test.go +++ b/virtcontainers/kata_agent_test.go @@ -450,7 +450,7 @@ func TestConstraintGRPCSpec(t *testing.T) { // check nil fields assert.Nil(g.Hooks) assert.Nil(g.Linux.Seccomp) - assert.Nil(g.Linux.Resources.Devices) + assert.NotNil(g.Linux.Resources.Devices) assert.NotNil(g.Linux.Resources.Memory) assert.Nil(g.Linux.Resources.Pids) assert.Nil(g.Linux.Resources.BlockIO)