From bdb19b82ef2aa1638d98da4b1c55ae7928437f55 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Tue, 18 Jun 2019 14:45:50 -0700 Subject: Add Container/Sandbox args struct for creation There were 3 string arguments that could be easily misplaced and it makes it easier to add new arguments, especially for Container that has dozens of callers. PiperOrigin-RevId: 253872074 --- runsc/cmd/run.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'runsc/cmd/run.go') diff --git a/runsc/cmd/run.go b/runsc/cmd/run.go index c1734741d..ee14dc3d9 100644 --- a/runsc/cmd/run.go +++ b/runsc/cmd/run.go @@ -81,7 +81,15 @@ func (r *Run) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) s } specutils.LogSpec(spec) - ws, err := container.Run(id, spec, conf, bundleDir, r.consoleSocket, r.pidFile, r.userLog, r.detach) + runArgs := container.Args{ + ID: id, + Spec: spec, + BundleDir: bundleDir, + ConsoleSocket: r.consoleSocket, + PIDFile: r.pidFile, + UserLog: r.userLog, + } + ws, err := container.Run(conf, runArgs, r.detach) if err != nil { return Errorf("running container: %v", err) } -- cgit v1.2.3