summaryrefslogtreecommitdiff
path: root/daemon/exec_linux_test.go
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2022-05-10 15:59:00 -0400
committerCory Snider <csnider@mirantis.com>2022-08-24 14:59:08 -0400
commit4bafaa00aa810dd17fde13e563def08f96fffc31 (patch)
tree1a376567983fba9b6619b9a8d93bf21fcb6208f6 /daemon/exec_linux_test.go
parent57d2d6ef621cc126ca904e8fc98fbacbd345790a (diff)
downloaddocker-4bafaa00aa810dd17fde13e563def08f96fffc31.tar.gz
Refactor libcontainerd to minimize c8d RPCs
The containerd client is very chatty at the best of times. Because the libcontained API is stateless and references containers and processes by string ID for every method call, the implementation is essentially forced to use the containerd client in a way which amplifies the number of redundant RPCs invoked to perform any operation. The libcontainerd remote implementation has to reload the containerd container, task and/or process metadata for nearly every operation. This in turn amplifies the number of context switches between dockerd and containerd to perform any container operation or handle a containerd event, increasing the load on the system which could otherwise be allocated to workloads. Overhaul the libcontainerd interface to reduce the impedance mismatch with the containerd client so that the containerd client can be used more efficiently. Split the API out into container, task and process interfaces which the consumer is expected to retain so that libcontainerd can retain state---especially the analogous containerd client objects---without having to manage any state-store inside the libcontainerd client. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'daemon/exec_linux_test.go')
-rw-r--r--daemon/exec_linux_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/exec_linux_test.go b/daemon/exec_linux_test.go
index ffef343898..17df7e16ad 100644
--- a/daemon/exec_linux_test.go
+++ b/daemon/exec_linux_test.go
@@ -4,13 +4,13 @@
package daemon
import (
+ "context"
"testing"
"github.com/containerd/containerd/pkg/apparmor"
containertypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/container"
"github.com/docker/docker/daemon/config"
- "github.com/docker/docker/daemon/exec"
specs "github.com/opencontainers/runtime-spec/specs-go"
"gotest.tools/v3/assert"
)
@@ -79,10 +79,10 @@ func TestExecSetPlatformOptAppArmor(t *testing.T) {
Privileged: tc.privileged,
},
}
- ec := &exec.Config{Privileged: execPrivileged}
+ ec := &container.ExecConfig{Container: c, Privileged: execPrivileged}
p := &specs.Process{}
- err := d.execSetPlatformOpt(c, ec, p)
+ err := d.execSetPlatformOpt(context.Background(), ec, p)
assert.NilError(t, err)
assert.Equal(t, p.ApparmorProfile, tc.expectedProfile)
})