Skip to content

Commit 72b5edb

Browse files
author
Kazuyoshi Kato
committed
Make Firecracker's instance ID configurable
Firecracker's instance ID is appeared in Firecracker's log file. Setting the ID makes the log easily trackable from clients. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 901dd61 commit 72b5edb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

runtime/noop_jailer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func newNoopJailer(ctx context.Context, logger *logrus.Entry, shimDir vm.Dir) *n
4444
}
4545
}
4646

47-
func (j *noopJailer) BuildJailedMachine(cfg *config.Config, machineConfig *firecracker.Config, vmID string) ([]firecracker.Opt, error) {
47+
func (j *noopJailer) BuildJailedMachine(cfg *config.Config, _ *firecracker.Config, vmID string) ([]firecracker.Opt, error) {
4848
if len(cfg.FirecrackerBinaryPath) == 0 {
4949
return []firecracker.Opt{}, nil
5050
}
@@ -57,6 +57,7 @@ func (j *noopJailer) BuildJailedMachine(cfg *config.Config, machineConfig *firec
5757
cmd := firecracker.VMCommandBuilder{}.
5858
WithBin(cfg.FirecrackerBinaryPath).
5959
WithSocketPath(relSocketPath).
60+
WithArgs([]string{"--id", vmID}).
6061
Build(j.ctx)
6162

6263
if cfg.DebugHelper.LogFirecrackerOutput() {

runtime/runc_jailer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ func (j *runcJailer) setDefaultConfigValues(cfg *config.Config, socketPath strin
451451
cmd := firecracker.VMCommandBuilder{}.
452452
WithBin("/" + firecrackerFileName).
453453
WithSocketPath(socketPath).
454+
WithArgs([]string{"--id", j.vmID}).
454455
// Don't need to pass in an actual context here as we are only building
455456
// the command arguments and not actually building a command
456457
Build(context.Background())

0 commit comments

Comments
 (0)