-
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
Overlay mounts supersede image volumes & volumes-from #24565
base: main
Are you sure you want to change the base?
Conversation
test/e2e/run_volume_test.go
Outdated
@@ -1089,4 +1089,20 @@ RUN chmod 755 /test1 /test2 /test3`, ALPINE) | |||
Expect(checkCtr.OutputToString()).To(ContainSubstring("foo")) | |||
Expect(checkCtr.OutputToString()).To(ContainSubstring("bar")) | |||
}) | |||
|
|||
It("user-specified overlay supersedes image volume", func() { | |||
err = podmanTest.RestoreArtifact(REDIS_IMAGE) |
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.
is the restore actually needed?
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.
We need something with an image volume, Redis has an image volume, and the other tests in the file use it.
I can probably convert over to nginx which I think is cached?
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.
Actually nginx does not have an image volume, I was misremembering.
I could build an image locally based on alpine with a volume but I don't know if that's any faster.
for dest := range baseMounts { | ||
if _, ok := baseVolumes[dest]; ok { | ||
return nil, nil, nil, fmt.Errorf("baseMounts conflict at mount destination %v: %w", dest, specgen.ErrDuplicateDest) | ||
} | ||
if _, ok := unifiedOverlays[dest]; ok { | ||
return nil, nil, nil, fmt.Errorf("baseMounts conflict with overlay mount at mount destination %v: %w", dest, specgen.ErrDuplicateDest) |
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.
I don't quite follow the code, how would one trigger this error condition? Can we test that?
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.
Sure, easily. podman run -v myvol:/test -v /my-overlay-mount:/test:O ...
. I'll add it.
This matches the behavior of other volume and mount types. Image volumes and volumes/mounts from the `--volumes-from` flag should be overridden by actual user-specified named volumes and mounts, but this was not true for overlay mounts. Fortunately, our duplicate-mount detection logic still works, so we got a good error message at least. The fix is simple - extend our supersede logic, which currently only works with named volumes and mounts, to also work with overlay mounts. Fixes containers#24555 Signed-off-by: Matt Heon <[email protected]>
One flake, looked network related, green otherwise. @containers/podman-maintainers 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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, mheon 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 |
This matches the behavior of other volume and mount types. Image volumes and volumes/mounts from the
--volumes-from
flag should be overridden by actual user-specified named volumes and mounts, but this was not true for overlay mounts. Fortunately, our duplicate-mount detection logic still works, so we got a good error message at least.The fix is simple - extend our supersede logic, which currently only works with named volumes and mounts, to also work with overlay mounts.
Fixes #24555
Does this PR introduce a user-facing change?