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 /libpod/options.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 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index a02c05537..4b6803c3f 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -435,6 +435,21 @@ func WithDefaultInfraCommand(cmd string) RuntimeOption { } } +// WithReset instructs libpod to reset all storage to factory defaults. +// All containers, pods, volumes, images, and networks will be removed. +// All directories created by Libpod will be removed. +func WithReset() RuntimeOption { + return func(rt *Runtime) error { + if rt.valid { + return define.ErrRuntimeFinalized + } + + rt.doReset = true + + return nil + } +} + // WithRenumber instructs libpod to perform a lock renumbering while // initializing. This will handle migrations from early versions of libpod with // file locks to newer versions with SHM locking, as well as changes in the |