summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-09-27 10:25:19 -0700
committerShentubot <shentubot@google.com>2018-09-27 10:26:34 -0700
commitb514ab05897bca53c1d4f71c912f2977b3134daf (patch)
treefd900cccf6d4f8d9fe9a54ec4ea1e8de13df1bb8 /runsc/cmd
parent6910ff36434f4bc5aa8c6b3094b617c7c92a9803 (diff)
Refactor 'runsc boot' to take container ID as argument
This makes the flow slightly simpler (no need to call Loader.SetRootContainer). And this is required change to tag tasks with container ID inside the Sentry. PiperOrigin-RevId: 214795210 Change-Id: I6ff4af12e73bb07157f7058bb15fd5bb88760884
Diffstat (limited to 'runsc/cmd')
-rw-r--r--runsc/cmd/boot.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/runsc/cmd/boot.go b/runsc/cmd/boot.go
index 035147cf1..933ba2d9e 100644
--- a/runsc/cmd/boot.go
+++ b/runsc/cmd/boot.go
@@ -69,7 +69,7 @@ func (*Boot) Synopsis() string {
// Usage implements subcommands.Command.Usage.
func (*Boot) Usage() string {
- return `boot [flags]`
+ return `boot [flags] <container id>`
}
// SetFlags implements subcommands.Command.SetFlags.
@@ -86,7 +86,7 @@ func (b *Boot) SetFlags(f *flag.FlagSet) {
// Execute implements subcommands.Command.Execute. It starts a sandbox in a
// waiting state.
func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
- if b.specFD == -1 || b.controllerFD == -1 || f.NArg() != 0 {
+ if b.specFD == -1 || b.controllerFD == -1 || f.NArg() != 1 {
f.Usage()
return subcommands.ExitUsageError
}
@@ -138,7 +138,7 @@ func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
}
// Create the loader.
- l, err := boot.New(spec, conf, b.controllerFD, b.deviceFD, b.ioFDs.GetArray(), b.console)
+ l, err := boot.New(f.Arg(0), spec, conf, b.controllerFD, b.deviceFD, b.ioFDs.GetArray(), b.console)
if err != nil {
Fatalf("error creating loader: %v", err)
}