Add emptyDir volume support to kube play

When a kube yaml has a volume set as empty dir, podman
will create an anonymous volume with the empty dir name and
attach it to the containers running in the pod. When the pod
is removed, the empy dir volume created is also removed.

Add tests and docs for this as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
Urvashi Mohnani
2022-07-24 19:44:41 -04:00
parent 57441b4c71
commit 98169c20dd
11 changed files with 98 additions and 15 deletions

View File

@ -1413,9 +1413,10 @@ func WithNamedVolumes(volumes []*ContainerNamedVolume) CtrCreateOption {
}
ctr.config.NamedVolumes = append(ctr.config.NamedVolumes, &ContainerNamedVolume{
Name: vol.Name,
Dest: vol.Dest,
Options: mountOpts,
Name: vol.Name,
Dest: vol.Dest,
Options: mountOpts,
IsAnonymous: vol.IsAnonymous,
})
}