Add support for image volume subpaths

Image volumes (the `--mount type=image,...` kind, not the
`podman volume create --driver image ...` kind - it's strange
that we have two) are needed for our automount scheme, but the
request is that we mount only specific subpaths from the image
into the container. To do that, we need image volume subpath
support. Not that difficult code-wise, mostly just plumbing.

Also, add support to the CLI; not strictly necessary, but it
doesn't hurt anything and will make testing easier.

Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
Matt Heon
2024-04-18 14:56:19 -04:00
parent 273020160c
commit 693ae0ebc6
8 changed files with 47 additions and 2 deletions

View File

@ -275,6 +275,8 @@ type ContainerImageVolume struct {
Dest string `json:"dest"`
// ReadWrite sets the volume writable.
ReadWrite bool `json:"rw"`
// SubPath determines which part of the image will be mounted into the container.
SubPath string `json:"subPath,omitempty"`
}
// ContainerSecret is a secret that is mounted in a container