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:
@@ -35,9 +35,10 @@ type worker struct {
|
||||
count int
|
||||
failures int
|
||||
|
||||
client *containerd.Client
|
||||
image containerd.Image
|
||||
commit string
|
||||
client *containerd.Client
|
||||
image containerd.Image
|
||||
commit string
|
||||
snapshotter string
|
||||
}
|
||||
|
||||
func (w *worker) run(ctx, tctx context.Context) {
|
||||
@@ -74,6 +75,7 @@ func (w *worker) run(ctx, tctx context.Context) {
|
||||
func (w *worker) runContainer(ctx context.Context, id string) (err error) {
|
||||
// fix up cgroups path for a default config
|
||||
c, err := w.client.NewContainer(ctx, id,
|
||||
containerd.WithSnapshotter(w.snapshotter),
|
||||
containerd.WithNewSnapshot(id, w.image),
|
||||
containerd.WithNewSpec(oci.WithImageConfig(w.image), oci.WithUsername("games"), oci.WithProcessArgs("true")),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user