mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #12767 from riyad/fix-storage-opt-double-decode
Prevent double decoding of storage options
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user