@@ -31,7 +31,6 @@ import (
3131
3232 "github.com/containerd/containerd"
3333 "github.com/containerd/containerd/cio"
34- "github.com/containerd/containerd/containers"
3534 "github.com/containerd/containerd/namespaces"
3635 "github.com/containerd/containerd/oci"
3736 "github.com/sirupsen/logrus"
@@ -76,11 +75,6 @@ var densityCommand = cli.Command{
7675 s := make (chan os.Signal , 1 )
7776 signal .Notify (s , syscall .SIGTERM , syscall .SIGINT )
7877
79- spec , err := oci .GenerateSpec (ctx , client ,
80- & containers.Container {},
81- oci .WithImageConfig (image ),
82- oci .WithProcessArgs ("sleep" , "120m" ),
83- )
8478 if err != nil {
8579 return err
8680 }
@@ -95,11 +89,13 @@ var densityCommand = cli.Command{
9589 break loop
9690 default :
9791 id := fmt .Sprintf ("density-%d" , i )
98- spec .Linux .CgroupsPath = filepath .Join ("/" , "density" , id )
9992
10093 c , err := client .NewContainer (ctx , id ,
10194 containerd .WithNewSnapshot (id , image ),
102- containerd .WithSpec (spec , oci .WithUsername ("games" )),
95+ containerd .WithNewSpec (
96+ oci .WithImageConfig (image ),
97+ oci .WithProcessArgs ("sleep" , "120m" ),
98+ oci .WithUsername ("games" )),
10399 )
104100 if err != nil {
105101 return err
0 commit comments