cmd: add --rdt-class command line option

A new option for setting the RDT class (or CLOS) from the command line.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
Markus Lehtonen 2021-04-07 11:16:09 +03:00
parent 2946db8903
commit 9e755d12e2
2 changed files with 8 additions and 0 deletions

View File

@ -193,6 +193,10 @@ var (
Name: "apparmor-profile", Name: "apparmor-profile",
Usage: "enable AppArmor with an existing custom profile", Usage: "enable AppArmor with an existing custom profile",
}, },
cli.StringFlag{
Name: "rdt-class",
Usage: "name of the RDT class to associate the container with. Specifies a Class of Service (CLOS) for cache and memory bandwidth management.",
},
} }
) )

View File

@ -324,6 +324,10 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
return nil return nil
}) })
} }
if c := context.String("rdt-class"); c != "" {
opts = append(opts, oci.WithRdt(c, "", ""))
}
} }
runtimeOpts, err := getRuntimeOptions(context) runtimeOpts, err := getRuntimeOptions(context)