podman/pkg/specgen
Matt Heon 30e2c923d6 Add the ability to automount images as volumes via play
Effectively, this is an ability to take an image already pulled
to the system, and automatically mount it into one or more
containers defined in Kubernetes YAML accepted by `podman play`.

Requirements:
- The image must already exist in storage.
- The image must have at least 1 volume directive.
- The path given by the volume directive will be mounted from the
  image into the container. For example, an image with a volume
  at `/test/test_dir` will have `/test/test_dir` in the image
  mounted to `/test/test_dir` in the container.
- Multiple images can be specified. If multiple images have a
  volume at a specific path, the last image specified trumps.
- The images are always mounted read-only.
- Images to mount are defined in the annotation
  "io.podman.annotations.kube.image.automount/$ctrname" as a
  semicolon-separated list. They are mounted into a single
  container in the pod, not the whole pod.

As we're using a nonstandard annotation, this is Podman only, any
Kubernetes install will just ignore this.

Underneath, this compiles down to an image volume
(`podman run --mount type=image,...`) with subpaths to specify
what bits we want to mount into the container.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 14:12:27 -04:00
..
generate Add the ability to automount images as volumes via play 2024-04-25 14:12:27 -04:00
container_validate.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
namespaces.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
namespaces_test.go drop support for "pasta" as a network name 2024-02-05 13:57:24 +01:00
pod_validate.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
podspecgen.go Add --restart flag to pod create 2023-05-02 10:29:58 -04:00
resources_freebsd.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
resources_linux.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
specgen.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
specgen_local.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_remote.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_test.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
utils.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volumes.go Add support for image volume subpaths 2024-04-25 14:12:27 -04:00
winpath.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
winpath_linux.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
winpath_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
winpath_windows.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00