Merge pull request #3656 from crosbymichael/stress
Fix density spec generation
This commit is contained in:
commit
c3452abae4
@ -31,7 +31,6 @@ import (
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/cio"
|
||||
"github.com/containerd/containerd/containers"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/oci"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -76,11 +75,6 @@ var densityCommand = cli.Command{
|
||||
s := make(chan os.Signal, 1)
|
||||
signal.Notify(s, syscall.SIGTERM, syscall.SIGINT)
|
||||
|
||||
spec, err := oci.GenerateSpec(ctx, client,
|
||||
&containers.Container{},
|
||||
oci.WithImageConfig(image),
|
||||
oci.WithProcessArgs("sleep", "120m"),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -95,11 +89,13 @@ var densityCommand = cli.Command{
|
||||
break loop
|
||||
default:
|
||||
id := fmt.Sprintf("density-%d", i)
|
||||
spec.Linux.CgroupsPath = filepath.Join("/", "density", id)
|
||||
|
||||
c, err := client.NewContainer(ctx, id,
|
||||
containerd.WithNewSnapshot(id, image),
|
||||
containerd.WithSpec(spec, oci.WithUsername("games")),
|
||||
containerd.WithNewSpec(
|
||||
oci.WithImageConfig(image),
|
||||
oci.WithProcessArgs("sleep", "120m"),
|
||||
oci.WithUsername("games")),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user