Skip to content

Commit

Permalink
Prevent double decoding of storage options
Browse files Browse the repository at this point in the history
[NO NEW TESTS NEEDED] see containers#11991

Signed-off-by: Riyad Preukschas <riyad@informatik.uni-bremen.de>
  • Loading branch information
riyad committed Jan 7, 2022
1 parent 8a22384 commit 7dada6d
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 7dada6d

Please sign in to comment.