aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/container.go')
-rw-r--r--container/container.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/container/container.go b/container/container.go
index a798084a..4208a449 100644
--- a/container/container.go
+++ b/container/container.go
@@ -67,6 +67,9 @@ type (
// Copied to the underlying [exec.Cmd].
WaitDelay time.Duration
+ // Suppress verbose output of init.
+ Quiet bool
+
cmd *exec.Cmd
ctx context.Context
msg message.Msg
@@ -342,8 +345,6 @@ func (p *Container) Start() error {
Err: ENOSYS,
Origin: true,
}
- } else {
- p.msg.Verbosef("landlock abi version %d", abi)
}
if rulesetFd, err := rulesetAttr.Create(0); err != nil {
@@ -353,7 +354,6 @@ func (p *Container) Start() error {
Err: err,
}
} else {
- p.msg.Verbosef("enforcing landlock ruleset %s", rulesetAttr)
if err = landlock.RestrictSelf(rulesetFd, 0); err != nil {
_ = Close(rulesetFd)
return &StartError{
@@ -410,7 +410,6 @@ func (p *Container) Start() error {
}
}
- p.msg.Verbose("starting container init")
if err := p.cmd.Start(); err != nil {
return &StartError{
Step: "start container init",
@@ -481,7 +480,6 @@ func (p *Container) Serve() (err error) {
}
case <-done:
- p.msg.Verbose("setup payload took", time.Since(t))
return
}
}(p.setup[1])
@@ -491,7 +489,7 @@ func (p *Container) Serve() (err error) {
Getuid(),
Getgid(),
len(p.ExtraFiles),
- p.msg.IsVerbose(),
+ p.msg.IsVerbose() && !p.Quiet,
})
}