Merge pull request #7082 from samuelkarp/ctr-hostname

ctr: add --hostname flag to create, run
This commit is contained in:
Akihiro Suda 2022-06-20 19:35:15 -05:00 committed by GitHub
commit b56cac143a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -201,6 +201,10 @@ var (
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.",
},
cli.StringFlag{
Name: "hostname",
Usage: "set the container's host name",
},
}
)

View File

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