mirror of
https://github.com/containerd/containerd.git
synced 2026-08-09 01:21:15 +00:00
ctr: add --scrub-logs flag for Windows
Adds a new --scrub-logs flag to ctr run on Windows. This flag enables
the ScrubLogs option for the io.containerd.runhcs.v1 shim.
Assisted-by: gemini-cli
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 18a01c0020)
This commit is contained in:
@@ -38,6 +38,10 @@ var platformRunFlags = []cli.Flag{
|
||||
Name: "isolated",
|
||||
Usage: "Run the container with vm isolation",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "scrub-logs",
|
||||
Usage: "Scrub sensitive information from the shim logs (Windows only)",
|
||||
},
|
||||
}
|
||||
|
||||
// NewContainer creates a new container
|
||||
@@ -172,9 +176,13 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
||||
runtime := context.String("runtime")
|
||||
var runtimeOpts interface{}
|
||||
if runtime == "io.containerd.runhcs.v1" {
|
||||
runtimeOpts = &options.Options{
|
||||
opts := &options.Options{
|
||||
Debug: context.GlobalBool("debug"),
|
||||
}
|
||||
if context.IsSet("scrub-logs") {
|
||||
opts.ScrubLogs = context.Bool("scrub-logs")
|
||||
}
|
||||
runtimeOpts = opts
|
||||
}
|
||||
cOpts = append(cOpts, containerd.WithRuntime(runtime, runtimeOpts))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user