-
Notifications
You must be signed in to change notification settings - Fork 2.7k
add artifact mount support #25397
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
Merged
Merged
add artifact mount support #25397
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
618e377
libartifact: create FilterBlobOptions
Luap99 4cd19b7
libartifact: fix comment on Extract()
Luap99 86a6539
libartifact: extract common code into helper
Luap99 7c200a5
libartifact: add BlobMountPaths()
Luap99 b232ea3
create artifact store in the libpod runtime
Luap99 51cfcc6
correctly preallocate artifactDigests in ArtifactRm()
Luap99 590bf8b
pkg/specgenutil: unexport Mounts()
Luap99 fe82fa8
pkg/specgenutil: rework volume/mount parsing
Luap99 f6e2d94
test/e2e: improve createArtifactFile()
Luap99 9e94dc5
add new artifact mount type
Luap99 c05908a
libartifact: NewArtifactStore() reject relative paths
Luap99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,12 +6,12 @@ | |||||
|
||||||
Attach a filesystem mount to the container | ||||||
|
||||||
Current supported mount TYPEs are **bind**, **devpts**, **glob**, **image**, **ramfs**, **tmpfs** and **volume**. | ||||||
Current supported mount TYPEs are **artifact**, **bind**, **devpts**, **glob**, **image**, **ramfs**, **tmpfs** and **volume**. | ||||||
|
||||||
Options common to all mount types: | ||||||
|
||||||
- *src*, *source*: mount source spec for **bind**, **glob**, and **volume**. | ||||||
Mandatory for **bind** and **glob**. | ||||||
Mandatory for **artifact**, **bind**, **glob**, **image** and **volume**. | ||||||
|
||||||
- *dst*, *destination*, *target*: mount destination spec. | ||||||
|
||||||
|
@@ -24,6 +24,25 @@ on the destination directory are mounted. The option | |||||
to mount host files matching /foo* to the /tmp/bar/ | ||||||
directory in the container. | ||||||
|
||||||
Options specific to type=**artifact**: | ||||||
|
||||||
- *digest*: If the artifact source contains multiple blobs a digest can be | ||||||
specified to only mount the one specific blob with the digest. | ||||||
|
||||||
- *title*: If the artifact source contains multiple blobs a title can be set | ||||||
which is compared against `org.opencontainers.image.title` annotation. | ||||||
|
||||||
The *src* argument contains the name of the artifact, it must already exist locally. | ||||||
The *dst* argument contains the target path, if the path in the container is a | ||||||
directory or does not exist the blob title (`org.opencontainers.image.title` | ||||||
annotation) will be used as filename and joined to the path. If the annotation | ||||||
does not exist the digest will be used as filename instead. This results in all blobs | ||||||
of the artifact mounted into the container at the given path. | ||||||
|
||||||
However if the *dst* path is a existing file in the container then the blob will be | ||||||
mounted directly on it. This only works when the artifact contains of a single blob | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
nits, if you have other changes. |
||||||
or when either *digest* or *title* are specified. | ||||||
|
||||||
Options specific to type=**volume**: | ||||||
|
||||||
- *ro*, *readonly*: *true* or *false* (default if unspecified: *false*). | ||||||
|
@@ -104,4 +123,6 @@ Examples: | |||||
|
||||||
- `type=tmpfs,destination=/path/in/container,noswap` | ||||||
|
||||||
- `type=volume,source=vol1,destination=/path/in/container,ro=true` | ||||||
- `type=artifact,src=quay.io/libpod/testartifact:20250206-single,dst=/data` | ||||||
|
||||||
- `type=artifact,src=quay.io/libpod/testartifact:20250206-multi,dst=/data,title=test1` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nits, if you have other updates.