diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-06-03 17:54:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-03 17:54:57 -0400 |
commit | 81f228b20a1d634821d2ff4b009f351366641847 (patch) | |
tree | eae904ecc6f8be6b9795141dcdfde23e950d0eda /pkg/domain/infra/runtime_libpod.go | |
parent | f4d8bf4afd291724a5ad4b342f76ec345eb76829 (diff) | |
parent | 259c79963f12d18b42d5455babf69b8ffdbb6b08 (diff) | |
download | podman-81f228b20a1d634821d2ff4b009f351366641847.tar.gz podman-81f228b20a1d634821d2ff4b009f351366641847.tar.bz2 podman-81f228b20a1d634821d2ff4b009f351366641847.zip |
Merge pull request #14466 from mheon/fix_9075
Improve robustness of `podman system reset`
Diffstat (limited to 'pkg/domain/infra/runtime_libpod.go')
-rw-r--r-- | pkg/domain/infra/runtime_libpod.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go index daa6f0cbf..03e7ffb5d 100644 --- a/pkg/domain/infra/runtime_libpod.go +++ b/pkg/domain/infra/runtime_libpod.go @@ -37,6 +37,7 @@ type engineOpts struct { migrate bool noStore bool withFDS bool + reset bool config *entities.PodmanConfig } @@ -48,6 +49,7 @@ func GetRuntimeMigrate(ctx context.Context, fs *flag.FlagSet, cfg *entities.Podm migrate: true, noStore: false, withFDS: true, + reset: false, config: cfg, }) } @@ -59,6 +61,7 @@ func GetRuntimeDisableFDs(ctx context.Context, fs *flag.FlagSet, cfg *entities.P migrate: false, noStore: false, withFDS: false, + reset: false, config: cfg, }) } @@ -70,6 +73,7 @@ func GetRuntimeRenumber(ctx context.Context, fs *flag.FlagSet, cfg *entities.Pod migrate: false, noStore: false, withFDS: true, + reset: false, config: cfg, }) } @@ -82,6 +86,7 @@ func GetRuntime(ctx context.Context, flags *flag.FlagSet, cfg *entities.PodmanCo migrate: false, noStore: false, withFDS: true, + reset: false, config: cfg, }) }) @@ -95,6 +100,18 @@ func GetRuntimeNoStore(ctx context.Context, fs *flag.FlagSet, cfg *entities.Podm migrate: false, noStore: true, withFDS: true, + reset: false, + config: cfg, + }) +} + +func GetRuntimeReset(ctx context.Context, fs *flag.FlagSet, cfg *entities.PodmanConfig) (*libpod.Runtime, error) { + return getRuntime(ctx, fs, &engineOpts{ + renumber: false, + migrate: false, + noStore: false, + withFDS: true, + reset: true, config: cfg, }) } @@ -161,6 +178,10 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo } } + if opts.reset { + options = append(options, libpod.WithReset()) + } + if opts.renumber { options = append(options, libpod.WithRenumber()) } |