Skip to content
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

Quadlet - explicit support for read-only-tmpfs #20479

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

ygalblum
Copy link
Contributor

Add Quadlet key and disconnect relationship with read-only
Update and add tests
Update man and remove reference to VolatileTmpfs

Does this PR introduce a user-facing change?

Yes

Quadlet - add support for ReadOnlyTmpfs and deprecate VolatileTmpfs

Resolves: #20439

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 25, 2023
@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate in the commit message why VolatileTmp is being removed?

@@ -521,6 +522,10 @@ This is equivalent to the Podman `--pull` option

If enabled, makes the image read-only.

### `ReadOnlyTmpfs=` (defaults to `yes`)

If container is running in ReadOnly is set to yes, then mount a read-write tmpfs on /dev, /dev/shm, /run, /tmp, and /var/tmp.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If container is running in ReadOnly is set to yes, then mount a read-write tmpfs on /dev, /dev/shm, /run, /tmp, and /var/tmp.
If container is running and ReadOnly is set to yes, then mount a read-write tmpfs on /dev, /dev/shm, /run, /tmp, and /var/tmp.

Should Quadlet error out if this option is set but ReadOnlyTmpfs is not (or turned off)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rephrased the sentence.

Should Quadlet error out if this option is set but ReadOnlyTmpfs is not (or turned off)?

In general, Quadlet does not validate the values or their relationship unless needed (e.g. NetworkSubnet, NetworkGateway and KeyNetworkIPRange). Furthermore, in this specific case, Podman does not fail if --read-only-tmpfs is set while --read-only isn't. So, I don't think Quadlet should validate the values

@ygalblum
Copy link
Contributor Author

Can you elaborate in the commit message why VolatileTmp is being removed?

I've updated the commit message

Add Quadlet key and disconnect relationship withr read-only
Update and add tests
Update man with new key

Remove the reference to VolatileTmpfs in the man page to reduce its
usage, since the same functionality can be achieved using the Tmpfs key
while keeping its support to maintain backward compatibility

Signed-off-by: Ygal Blum <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Oct 25, 2023

Worse named option ever and it gets proliferated. (It was named by me)
LGTM

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 25, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 25, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg, ygalblum

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/* !volatileTmp, disable the default tmpfs from --read-only */
podman.add("--read-only-tmpfs=false")
if volatileTmp && !readOnly {
podman.add("--tmpfs", "/tmp:rw,size=512M,mode=1777")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is pre-existing, but I dislike seeing stuff hardcoded like this. It would be nice to get at least the second string into a conf file somewhere. Not for now, a future consideration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking, I agree. But, with this change and the removal of this key from the man page we hope people will not use it anymore. The only reason it is still there is for backward compatibility and therefore I don't think we should change any of it.

@TomSweeneyRedHat
Copy link
Member

LGTM

@TomSweeneyRedHat
Copy link
Member

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 25, 2023
@openshift-ci openshift-ci bot merged commit 32ef2d7 into containers:main Oct 25, 2023
98 checks passed
@ygalblum ygalblum deleted the quadlet-read-only branch October 26, 2023 07:16
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quadlet option Readonly sets --read-only-tmpfs to false
4 participants