diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2017-11-20 14:45:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 14:45:01 -0500 |
commit | 6e0944f2f128534caaf884251d1e42fa4f1ba235 (patch) | |
tree | 4ecca5c1388b93de16b1dd91244ffb3488b0ddd1 /libpod/options.go | |
parent | 3e04604dc2619b1502b609083c3b6ecb0949f1d5 (diff) | |
parent | f2894eda689a24c069b55b1e2ad3e6136836b326 (diff) | |
download | podman-6e0944f2f128534caaf884251d1e42fa4f1ba235.tar.gz podman-6e0944f2f128534caaf884251d1e42fa4f1ba235.tar.bz2 podman-6e0944f2f128534caaf884251d1e42fa4f1ba235.zip |
Merge pull request #26 from mheon/sql_state
Implementation of SQL-backed state
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/libpod/options.go b/libpod/options.go index 10cb605c2..4c21a70c9 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -94,6 +94,20 @@ func WithSignaturePolicy(path string) RuntimeOption { } } +// WithInMemoryState specifies that the runtime will be backed by an in-memory +// state only, and state will not persist after the runtime is shut down +func WithInMemoryState() RuntimeOption { + return func(rt *Runtime) error { + if rt.valid { + return ErrRuntimeFinalized + } + + rt.config.InMemoryState = true + + return nil + } +} + // WithOCIRuntime specifies an OCI runtime to use for running containers func WithOCIRuntime(runtimePath string) RuntimeOption { return func(rt *Runtime) error { @@ -236,25 +250,6 @@ func WithNoPivotRoot(noPivot bool) RuntimeOption { // Container Creation Options -// WithRootFSFromPath uses the given path as a container's root filesystem -// No further setup is performed on this path -func WithRootFSFromPath(path string) CtrCreateOption { - return func(ctr *Container) error { - if ctr.valid { - return ErrCtrFinalized - } - - if ctr.config.RootfsDir != "" || ctr.config.RootfsImageID != "" || ctr.config.RootfsImageName != "" { - return errors.Wrapf(ErrInvalidArg, "container already configured with root filesystem") - } - - ctr.config.RootfsDir = path - ctr.config.RootfsFromImage = false - - return nil - } -} - // WithSELinuxMountLabel sets the mount label for SELinux func WithSELinuxMountLabel(mountLabel string) CtrCreateOption { return func(ctr *Container) error { @@ -277,14 +272,13 @@ func WithRootFSFromImage(imageID string, imageName string, useImageConfig bool) return ErrCtrFinalized } - if ctr.config.RootfsDir != "" || ctr.config.RootfsImageID != "" || ctr.config.RootfsImageName != "" { + if ctr.config.RootfsImageID != "" || ctr.config.RootfsImageName != "" { return errors.Wrapf(ErrInvalidArg, "container already configured with root filesystem") } ctr.config.RootfsImageID = imageID ctr.config.RootfsImageName = imageName ctr.config.UseImageConfig = useImageConfig - ctr.config.RootfsFromImage = true return nil } |