Skip to content

Commit

Permalink
Merge pull request containers#12767 from riyad/fix-storage-opt-double…
Browse files Browse the repository at this point in the history
…-decode

Prevent double decoding of storage options
  • Loading branch information
openshift-merge-robot authored Jan 7, 2022
2 parents 7dd7b98 + 7dada6d commit 0464011
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0464011

Please sign in to comment.