Skip to content

Commit

Permalink
Merge pull request firecracker-microvm#206 from mxpv/cleanup
Browse files Browse the repository at this point in the history
Remove ID flag from Agent
  • Loading branch information
mxpv authored Jun 11, 2019
2 parents ca4c8e3 + 773879a commit aba20fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package main

import (
"context"
"errors"
"flag"
"os"
"os/signal"
Expand Down Expand Up @@ -48,12 +47,10 @@ const (

func main() {
var (
id string
port int
debug bool
)

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

// verify arguments, id is required
if id == "" {
log.G(shimCtx).WithError(errors.New("invalid argument")).Fatal("id not set")
}

// Ensure this process is a subreaper or else containers created via runc will
// not be its children.
if err := sys.SetSubreaper(enableSubreaper); err != nil {
Expand All @@ -83,7 +75,7 @@ func main() {
// This can be wrapped to add missing functionality (like
// running multiple containers inside one Firecracker VM)

log.G(shimCtx).WithField("id", id).Info("creating runc shim")
log.G(shimCtx).Info("creating task service")

eventExchange := &event.ExchangeCloser{Exchange: exchange.NewExchange()}
taskService := NewTaskService(shimCtx, shimCancel, eventExchange)
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/fc-agent.start
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ touch /container/runtime

cd /container

exec /usr/local/bin/agent -id 1 -debug
exec /usr/local/bin/agent -debug
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Requires=local-fs.target
[Service]
Type=simple
WorkingDirectory=/container
ExecStart=/usr/local/bin/agent -id 1
ExecStart=/usr/local/bin/agent
Restart=always

0 comments on commit aba20fb

Please sign in to comment.