Skip to content

Commit aba20fb

Browse files
authored
Merge pull request firecracker-microvm#206 from mxpv/cleanup
Remove ID flag from Agent
2 parents ca4c8e3 + 773879a commit aba20fb

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

agent/main.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package main
1515

1616
import (
1717
"context"
18-
"errors"
1918
"flag"
2019
"os"
2120
"os/signal"
@@ -48,12 +47,10 @@ const (
4847

4948
func main() {
5049
var (
51-
id string
5250
port int
5351
debug bool
5452
)
5553

56-
flag.StringVar(&id, "id", "", "ContainerID (required)")
5754
flag.IntVar(&port, "port", defaultPort, "Vsock port to listen to")
5855
flag.BoolVar(&debug, "debug", false, "Turn on debug mode")
5956
flag.Parse()
@@ -68,11 +65,6 @@ func main() {
6865
shimCtx, shimCancel := context.WithCancel(namespaces.WithNamespace(context.Background(), defaultNamespace))
6966
group, shimCtx := errgroup.WithContext(shimCtx)
7067

71-
// verify arguments, id is required
72-
if id == "" {
73-
log.G(shimCtx).WithError(errors.New("invalid argument")).Fatal("id not set")
74-
}
75-
7668
// Ensure this process is a subreaper or else containers created via runc will
7769
// not be its children.
7870
if err := sys.SetSubreaper(enableSubreaper); err != nil {
@@ -83,7 +75,7 @@ func main() {
8375
// This can be wrapped to add missing functionality (like
8476
// running multiple containers inside one Firecracker VM)
8577

86-
log.G(shimCtx).WithField("id", id).Info("creating runc shim")
78+
log.G(shimCtx).Info("creating task service")
8779

8880
eventExchange := &event.ExchangeCloser{Exchange: exchange.NewExchange()}
8981
taskService := NewTaskService(shimCtx, shimCancel, eventExchange)

tools/docker/fc-agent.start

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ touch /container/runtime
66

77
cd /container
88

9-
exec /usr/local/bin/agent -id 1 -debug
9+
exec /usr/local/bin/agent -debug

tools/image-builder/files_debootstrap/etc/systemd/system/firecracker-agent.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ Requires=local-fs.target
1919
[Service]
2020
Type=simple
2121
WorkingDirectory=/container
22-
ExecStart=/usr/local/bin/agent -id 1
22+
ExecStart=/usr/local/bin/agent
2323
Restart=always

0 commit comments

Comments
 (0)