-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
support rootfs contains colon #11912
support rootfs contains colon #11912
Conversation
8dd7706
to
e482216
Compare
containers/buildah#3581 is required to support rootfs contains colon. |
One doubt from original issue #11913 (comment) |
pkg/specgen/specgen.go
Outdated
parts := strings.SplitN(csc.Rootfs, ":", 2) | ||
if len(parts) > 1 && parts[1] == "O" { | ||
parts := strings.Split(csc.Rootfs, ":") | ||
if len(parts) > 1 && parts[len(parts)-1] == "O" { |
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.
can we use strings.LastIndex(parts, ":")
instead of strings.Split
?
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.
Thanks for your suggestion. I use strings.LastIndex(parts, ":")
instead of strings.Split
. PTAL.
Fix: containers#11913 Signed-off-by: chenkang <kongchen28@gmail.com>
e482216
to
dd5975f
Compare
need rebase to one commit |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chenk008, giuseppe 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 |
What this PR does / why we need it:
For now, we can create a container with a readonly rootfs.
podman run --rootfs /some/readonly/path:O echo hello
The rootfs may contains colon
podman run --rootfs /some/a:b/readonly/path:O echo hello
, it will failed to parse this directory, the error message is
How to verify it
Run container with a readonly rootfs, and the rootfs path contains colon.
Which issue(s) this PR fixes:
Fixes #11913
Special notes for your reviewer: