Skip to content

Commit

Permalink
Merge pull request #16826 from alexlarsson/quadlet-more-defaults
Browse files Browse the repository at this point in the history
quadlet: Default VolatileTmp to off
  • Loading branch information
openshift-merge-robot authored Dec 14, 2022
2 parents ad5c0be + fd92a68 commit 2a48296
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-systemd.unit.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ The timezone to run the container in.
If enabled, the container will have a minimal init process inside the
container that forwards signals and reaps processes.

#### `VolatileTmp=` (default to `yes`)
#### `VolatileTmp=` (default to `no`, or `yes` if `ReadOnly` enabled)

If enabled (and it is by default), the container will have a fresh tmpfs mounted on `/tmp`.
If enabled, the container will have a fresh tmpfs mounted on `/tmp`.

**NOTE:** Podman will automatically copy any content from the image onto the tmpfs

Expand Down
3 changes: 1 addition & 2 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
podman.add("--read-only")
}

// We want /tmp to be a tmpfs, like on rhel host
volatileTmp := container.LookupBoolean(ContainerGroup, KeyVolatileTmp, true)
volatileTmp := container.LookupBoolean(ContainerGroup, KeyVolatileTmp, false)
if volatileTmp {
/* Read only mode already has a tmpfs by default */
if !readOnly {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/quadlet/readwrite.container
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

[Container]
Image=localhost/imagename
VolatileTmp=yes
ReadOnly=no

0 comments on commit 2a48296

Please sign in to comment.