add cpu-burst param to ctr command

Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
rongfu.leng
2023-10-09 21:51:24 +08:00
parent ecda3b88ce
commit 8f3d1c9d9b
2 changed files with 13 additions and 0 deletions

View File

@@ -327,6 +327,10 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
opts = append(opts, oci.WithCPUCFS(quota, period))
}
if burst := context.Uint64("cpu-burst"); burst != 0 {
opts = append(opts, oci.WithCPUBurst(burst))
}
joinNs := context.StringSlice("with-ns")
for _, ns := range joinNs {
nsType, nsPath, ok := strings.Cut(ns, ":")