containerd-stress: add snapshotter option for stress test to use

containerd-stress utility needs to be able to run with snapshotter
passed by user in cli in order to be able to stress test snapshotters.
This adds a cli option --snapshotter="<snapshotter-name>"

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
This commit is contained in:
Alakesh Haloi
2021-04-06 22:54:59 +00:00
parent 054a3e281e
commit 0550c32330
4 changed files with 29 additions and 15 deletions

View File

@@ -42,6 +42,7 @@ func (w *execWorker) exec(ctx, tctx context.Context) {
id := fmt.Sprintf("exec-container-%d", w.id)
c, err := w.client.NewContainer(ctx, id,
containerd.WithNewSnapshot(id, w.image),
containerd.WithSnapshotter(w.snapshotter),
containerd.WithNewSpec(oci.WithImageConfig(w.image), oci.WithUsername("games"), oci.WithProcessArgs("sleep", "30d")),
)
if err != nil {