-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.4] volumes: be more tolerant and fix infinite loop #12211
[3.4] volumes: be more tolerant and fix infinite loop #12211
Conversation
Make Podman more tolerant when parsing image volumes during container creation and further fix an infinite loop when checking them. Consider `VOLUME ['/etc/foo', '/etc/bar']` in a Containerfile. While it looks correct to the human eye, the single quotes are wrong and yield the two volumes to be `[/etc/foo,` and `/etc/bar]` in Podman and Docker. When running the container, it'll create a directory `bar]` in `/etc` and a directory `[` in `/` with two subdirectories `etc/foo,`. This behavior is surprising to me but how Docker behaves. We may improve on that in the future. Note that the correct way to syntax for volumes in a Containerfile is `VOLUME /A /B /C` or `VOLUME ["/A", "/B", "/C"]`; single quotes are not supported. This change restores this behavior without breaking container creation or ending up in an infinite loop. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2014149 Signed-off-by: Valentin Rothberg <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mheon @TomSweeneyRedHat PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/lgtm |
I wonder if we need a |
@mheon, we need to get an update v3.4.* to RHEL 8.5.0.2 for next week. I think we want to get a v3.4.1-rhel branch and then spin up a v3.4.2 release from it. Maybe a ps in standup today? |
Make Podman more tolerant when parsing image volumes during container
creation and further fix an infinite loop when checking them.
Consider
VOLUME ['/etc/foo', '/etc/bar']
in a Containerfile. Whileit looks correct to the human eye, the single quotes are wrong and yield
the two volumes to be
[/etc/foo,
and/etc/bar]
in Podman and Docker.When running the container, it'll create a directory
bar]
in/etc
and a directory
[
in/
with two subdirectoriesetc/foo,
. Thisbehavior is surprising to me but how Docker behaves. We may improve on
that in the future. Note that the correct way to syntax for volumes in
a Containerfile is
VOLUME /A /B /C
orVOLUME ["/A", "/B", "/C"]
;single quotes are not supported.
This change restores this behavior without breaking container creation
or ending up in an infinite loop.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2014149
Signed-off-by: Valentin Rothberg [email protected]