Skip to content

Commit

Permalink
volumes: do not pass mount opt as formatter string
Browse files Browse the repository at this point in the history
otherwise passing a formatter string as an option causes a weird
error message:

$ podman run --mount type=devpts,destination=/dev/pts,%sfoo ...
Error: %!s(MISSING)foo: invalid mount option

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Oct 28, 2021
1 parent 3bc4493 commit e6286fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/specgenutil/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func getBindMount(args []string) (spec.Mount, error) {
// Since Docker ignores this option so shall we.
continue
default:
return newMount, errors.Wrapf(util.ErrBadMntOption, kv[0])
return newMount, errors.Wrapf(util.ErrBadMntOption, "%s", kv[0])
}
}

Expand Down Expand Up @@ -460,7 +460,7 @@ func getTmpfsMount(args []string) (spec.Mount, error) {
// Since Docker ignores this option so shall we.
continue
default:
return newMount, errors.Wrapf(util.ErrBadMntOption, kv[0])
return newMount, errors.Wrapf(util.ErrBadMntOption, "%s", kv[0])
}
}

Expand Down Expand Up @@ -493,7 +493,7 @@ func getDevptsMount(args []string) (spec.Mount, error) {
newMount.Destination = filepath.Clean(kv[1])
setDest = true
default:
return newMount, errors.Wrapf(util.ErrBadMntOption, kv[0])
return newMount, errors.Wrapf(util.ErrBadMntOption, "%s", kv[0])
}
}

Expand Down Expand Up @@ -573,7 +573,7 @@ func getNamedVolume(args []string) (*specgen.NamedVolume, error) {
// Since Docker ignores this option so shall we.
continue
default:
return nil, errors.Wrapf(util.ErrBadMntOption, kv[0])
return nil, errors.Wrapf(util.ErrBadMntOption, "%s", kv[0])
}
}

Expand Down Expand Up @@ -624,7 +624,7 @@ func getImageVolume(args []string) (*specgen.ImageVolume, error) {
// Since Docker ignores this option so shall we.
continue
default:
return nil, errors.Wrapf(util.ErrBadMntOption, kv[0])
return nil, errors.Wrapf(util.ErrBadMntOption, "%s", kv[0])
}
}

Expand Down

0 comments on commit e6286fb

Please sign in to comment.