diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-04-16 14:12:12 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-04-26 22:23:49 +0200 |
commit | f49e0c19ede56b1cc6b1d44ea9ba8b336cd22658 (patch) | |
tree | 9a68b96d5f85adcc67189e97e1c788786c20b32c /cmd/podman/libpodruntime | |
parent | 525f0b30ac280565a1f98fd4208821a4984a7515 (diff) | |
download | podman-f49e0c19ede56b1cc6b1d44ea9ba8b336cd22658.tar.gz podman-f49e0c19ede56b1cc6b1d44ea9ba8b336cd22658.tar.bz2 podman-f49e0c19ede56b1cc6b1d44ea9ba8b336cd22658.zip |
runtime: pass down the context
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/libpodruntime')
-rw-r--r-- | cmd/podman/libpodruntime/runtime.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go index 595f8267f..b03846bbc 100644 --- a/cmd/podman/libpodruntime/runtime.go +++ b/cmd/podman/libpodruntime/runtime.go @@ -1,6 +1,8 @@ package libpodruntime import ( + "context" + "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/libpod" "github.com/containers/libpod/pkg/rootless" @@ -10,21 +12,21 @@ import ( ) // GetRuntimeMigrate gets a libpod runtime that will perform a migration of existing containers -func GetRuntimeMigrate(c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { - return getRuntime(c, false, true) +func GetRuntimeMigrate(ctx context.Context, c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { + return getRuntime(ctx, c, false, true) } // GetRuntimeRenumber gets a libpod runtime that will perform a lock renumber -func GetRuntimeRenumber(c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { - return getRuntime(c, true, false) +func GetRuntimeRenumber(ctx context.Context, c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { + return getRuntime(ctx, c, true, false) } // GetRuntime generates a new libpod runtime configured by command line options -func GetRuntime(c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { - return getRuntime(c, false, false) +func GetRuntime(ctx context.Context, c *cliconfig.PodmanCommand) (*libpod.Runtime, error) { + return getRuntime(ctx, c, false, false) } -func getRuntime(c *cliconfig.PodmanCommand, renumber bool, migrate bool) (*libpod.Runtime, error) { +func getRuntime(ctx context.Context, c *cliconfig.PodmanCommand, renumber bool, migrate bool) (*libpod.Runtime, error) { options := []libpod.RuntimeOption{} storageOpts := storage.StoreOptions{} storageSet := false @@ -76,6 +78,8 @@ func getRuntime(c *cliconfig.PodmanCommand, renumber bool, migrate bool) (*libpo options = append(options, libpod.WithRenumber()) } + options = append(options, libpod.WithContext(ctx)) + // Only set this if the user changes storage config on the command line if storageSet { options = append(options, libpod.WithStorageConfig(storageOpts)) |