-
Notifications
You must be signed in to change notification settings - Fork 757
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
overlay, mount: add support for non-volatile upperdir
, workdir
for overlay volumes
#3715
overlay, mount: add support for non-volatile upperdir
, workdir
for overlay volumes
#3715
Conversation
73f29ed
to
031cdaa
Compare
Please elaborate on the use case, and add tests. |
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.
Warning: I know nothing about overlay (I don’t think I have ever manually mounted one) except what I just read in the documentation, and I know even less about how c/storage uses it.
pkg/overlay/overlay.go
Outdated
// MountWithOptions creates a subdir of the contentDir based on the source directory | ||
// from the source system. It then mounts up the source directory on to the | ||
// generated mount point and returns the mount point to the caller. | ||
// But allows api to set custom workdir, upperdir and other overlay options |
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.
FWIW – this is preexisting, and maybe I’m just ignorant. This documentation, even with the context of the overlay section of mount(8), is completely unintelligible to me. I have no idea how source
/contentDir
relate.
(Reading the code, apparently contentDir
has a specific structure that’s not documented in this package.)
The other options are also undocumented.
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.
… and the behavior of readonly
, affecting whether $contentDir/lower
is used, is completely non-obvious to me as a newcomer to the code.
b4364a9
to
d4d3cda
Compare
d4d3cda
to
5a72d36
Compare
5a72d36
to
fe5ebb3
Compare
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.
Code LGTM, just documentation nits.
[NO NEW TESTS NEEDED]
Is this appropriate here?
fe5ebb3
to
e92d00a
Compare
Updated Docs.
@nalind @mtrmac Following API is only used by podman and its much easier to test there -> containers/podman#12712 . We don't have flat tests for But if it does not breaks any existing buildah tests then should this be fine ? |
@TomSweeneyRedHat I am also extending feature to buildah so we can test here as well. Edit: @nalind @mtrmac extended buildah to support this feature to buildah as well and added a test for this. |
e92d00a
to
df7e4fe
Compare
MountWithOptions
to API which extends support for advanced overlay
users.upperdir
, workdir
for overlay volumes
…ed overlay Expose `MountWithOptions` for overlay which allows users to pass more verbose configuration for overlay mounts. For instance `upperdir, workerdir` and in future `volatile`. Signed-off-by: Aditya R <arajan@redhat.com>
440ee51
to
57b01d4
Compare
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 the tests!
Note that I’m just reading the diff.. I don’t know anything about the testing infrastructure, and I’ll defer to repo owners on the introduced UI.
57b01d4
to
818bdda
Compare
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.
Code looks reasonable. Some nits about field names and some typos.
// See discussion here for more context: https://github.com/containers/buildah/pull/3715#discussion_r786036959 | ||
// TODO: Should we address above comment and handle escaping of metacharacters like | ||
// `comma`, `backslash` ,`colon` and any other specical characters | ||
UpperDirOptionFragment string |
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.
Nit: the OptionFragment
suffix sounds redundant.
Should probably note that if this field is set, WorkDirOptionFragment
should also be set.
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.
@nalind I decided to name both of them as fragment as they are still just fragments to overlay's options as discussed here #3715 (comment) . I named both of them in same manner as it describes the similar nature of field to the reader of the API
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.
@nalind See that discussion, but I’m completely happy to leave naming/API design to you.
// See discussion here for more context: https://github.com/containers/buildah/pull/3715#discussion_r786036959 | ||
// TODO: Should we address above comment and handle escaping of metacharacters like | ||
// `comma`, `backslash` ,`colon` and any other specical characters | ||
WorkDirOptionFragment string |
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.
Nit: the OptionFragment
suffix sounds redundant. Should probably note that if this field is set, UpperDirOptionFragment
should also be set.
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.
Reasoning for this is same as #3715 (comment)
818bdda
to
03d1da1
Compare
Allow users to specify non-volatile `upper` and `workdir` with overlay mounts. Usage ```console buildah from alpine buildah run -v /something/lower:/test:z,O,upperdir=/somewhere/upperdir,workdir=/somwhere/workdir alpine-working-container cat /test/hello ``` Signed-off-by: Aditya R <arajan@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
03d1da1
to
685121b
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, rhatdan 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 |
Expose
MountWithOptions
for overlay which allows users to pass moreverbose configuration for overlay mounts.
For instance
upperdir, workerdir
and in futurevolatile
.Allow users to specify non-volatile
upper
andworkdir
with overlaymounts.
Usage
Needed for: containers/podman#12712