diff options
author | Fabricio Voznika <fvoznika@google.com> | 2020-10-22 22:04:57 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-22 22:07:06 -0700 |
commit | 293877cf647ac3e900f0ae15061317a512bba7a0 (patch) | |
tree | ca069b423d9baf52ac3fb583386ba303c93e1f06 /runsc/cmd | |
parent | cc772f3d54d46b65c663c8cf7812103df31f17d3 (diff) |
Load spec during "runsc start" to process flag overrides
Subcontainers are only configured when the container starts, however because
start doesn't load the spec, flag annotations that may override flags were
not getting applied to the configuration.
Updates #3494
PiperOrigin-RevId: 338610953
Diffstat (limited to 'runsc/cmd')
-rw-r--r-- | runsc/cmd/start.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runsc/cmd/start.go b/runsc/cmd/start.go index 88991b521..139edbd49 100644 --- a/runsc/cmd/start.go +++ b/runsc/cmd/start.go @@ -21,6 +21,7 @@ import ( "gvisor.dev/gvisor/runsc/config" "gvisor.dev/gvisor/runsc/container" "gvisor.dev/gvisor/runsc/flag" + "gvisor.dev/gvisor/runsc/specutils" ) // Start implements subcommands.Command for the "start" command. @@ -58,6 +59,12 @@ func (*Start) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) s if err != nil { Fatalf("loading container: %v", err) } + // Read the spec again here to ensure flag annotations from the spec are + // applied to "conf". + if _, err := specutils.ReadSpec(c.BundleDir, conf); err != nil { + Fatalf("reading spec: %v", err) + } + if err := c.Start(conf); err != nil { Fatalf("starting container: %v", err) } |