mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Avoid duplicate --attached flag when re-exec-ing boot process.
Some parameters are not already part of os.Args because they are solely configured by Boot.Execute(). These need to be manually added in Boot.prepareArgs(). But --attached is *not* one of these parameters. It is not configured by boot process, it is configured by invokers of boot process. PiperOrigin-RevId: 529264276
This commit is contained in:
+3
-7
@@ -452,14 +452,10 @@ func (b *Boot) prepareArgs(exclude ...string) []string {
|
||||
}
|
||||
}
|
||||
args = append(args, arg)
|
||||
// Strategically add parameters after the command and before the container
|
||||
// ID at the end.
|
||||
// Some parameters are not already part of os.Args because they are
|
||||
// solely configured by Boot.Execute(). Strategically add these parameters
|
||||
// after the command and before the container ID at the end.
|
||||
if arg == "boot" {
|
||||
if b.attached {
|
||||
// This is needed to ensure the new process is killed when the parent
|
||||
// process terminates.
|
||||
args = append(args, "--attached")
|
||||
}
|
||||
if b.procMountSyncFD != -1 {
|
||||
args = append(args, fmt.Sprintf("--proc-mount-sync-fd=%d", b.procMountSyncFD))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user