diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-07 16:16:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 16:16:59 +0100 |
commit | 0464011a8ea705b31cf270407e76608c223c2f21 (patch) | |
tree | 1db54b601d01dabed6c21a13664b8669187156aa | |
parent | 7dd7b983b6bcbe5e6acd05c674c38ac3312ba391 (diff) | |
parent | 7dada6d49288379e7e254b4aa9b62b3db91a05aa (diff) | |
download | podman-0464011a8ea705b31cf270407e76608c223c2f21.tar.gz podman-0464011a8ea705b31cf270407e76608c223c2f21.tar.bz2 podman-0464011a8ea705b31cf270407e76608c223c2f21.zip |
Merge pull request #12767 from riyad/fix-storage-opt-double-decode
Prevent double decoding of storage options
-rw-r--r-- | libpod/container_internal.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 2d12a90d1..33bb35a0b 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -447,17 +447,8 @@ func (c *Container) setupStorage(ctx context.Context) error { LabelOpts: c.config.LabelOpts, } - nopts := len(c.config.StorageOpts) - if nopts > 0 { - options.StorageOpt = make(map[string]string, nopts) - for _, opt := range c.config.StorageOpts { - split2 := strings.SplitN(opt, "=", 2) - if len(split2) > 2 { - return errors.Wrapf(define.ErrInvalidArg, "invalid storage options %q for %s", opt, c.ID()) - } - options.StorageOpt[split2[0]] = split2[1] - } - } + options.StorageOpt = c.config.StorageOpts + if c.restoreFromCheckpoint && c.config.ProcessLabel != "" && c.config.MountLabel != "" { // If restoring from a checkpoint, the root file-system needs // to be mounted with the same SELinux labels as it was mounted |