diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-11 09:59:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 09:59:52 -0700 |
commit | 745993b592903544e5a3b38ae9336e65c56874f4 (patch) | |
tree | 87fbc14c5e815a56100d38d8e6d62f4186bd781b /libpod | |
parent | ab259987ee4920e549a863ab3b7055877d6f61d7 (diff) | |
parent | aef09ce031d169a7a5c0c8460ee6ec231bbf5a11 (diff) | |
download | podman-745993b592903544e5a3b38ae9336e65c56874f4.tar.gz podman-745993b592903544e5a3b38ae9336e65c56874f4.tar.bz2 podman-745993b592903544e5a3b38ae9336e65c56874f4.zip |
Merge pull request #2895 from mheon/commit_no_default_include_volumes
Add --include-volumes flag to 'podman commit'
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_commit.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libpod/container_commit.go b/libpod/container_commit.go index 0604a550b..db67f7a30 100644 --- a/libpod/container_commit.go +++ b/libpod/container_commit.go @@ -20,10 +20,11 @@ import ( //libpod type ContainerCommitOptions struct { buildah.CommitOptions - Pause bool - Author string - Message string - Changes []string + Pause bool + IncludeVolumes bool + Author string + Message string + Changes []string } // ChangeCmds is the list of valid Changes commands to passed to the Commit call @@ -113,9 +114,11 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai // User importBuilder.SetUser(c.User()) // Volumes - for _, v := range c.config.UserVolumes { - if v != "" { - importBuilder.AddVolume(v) + if options.IncludeVolumes { + for _, v := range c.config.UserVolumes { + if v != "" { + importBuilder.AddVolume(v) + } } } // Workdir |