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]: Add support for --sysctl #18727

Closed
LauKr opened this issue May 29, 2023 · 3 comments · Fixed by #18785
Closed

[Quadlet]: Add support for --sysctl #18727

LauKr opened this issue May 29, 2023 · 3 comments · Fixed by #18785
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet

Comments

@LauKr
Copy link
Contributor

LauKr commented May 29, 2023

Feature request description

As far as I saw there is no support for the --sysctl flag up to now for Quadlet.
When using --sysctl for a container, this, at least to my understanding, makes it impossible to simultaneously use Quadlet.

Suggest potential solution

I think this can easily be done similar to other options, like e.g. AddCapability in quadlet.go, something like:

	addSysctl := container.LookupAllStrv(ContainerGroup, KeyAddSysctl)
	for _, sysctl := range addSysctl {
		podman.addf("--sysctl=%s", strings.ToLower(sysctl))
	}

As this is neither tested yet nor I'm fluent in Go, please take with a grain of salt. Also, I'm not sure if the input should be filtered for allowed entries based on namespaces, or if Podman throwing the corresponding error is enough.

Have you considered any alternatives?

One could always use the podman generate command to generate a separate unit file based on the used container, but mixing different types of container administration is not ideal.

Additional context

No response

@LauKr LauKr added the kind/feature Categorizes issue or PR as related to a new feature. label May 29, 2023
@Luap99
Copy link
Member

Luap99 commented May 30, 2023

You can use PodmanArgs= to set arbitrary podman args that are not directly exposed in quadlet.
In any case this sounds like a reasonable request to support it directly in quadlet.

@Luap99 Luap99 added the quadlet label May 30, 2023
@rhatdan
Copy link
Member

rhatdan commented May 30, 2023

I agree.

@LauKr
Copy link
Contributor Author

LauKr commented Jun 2, 2023

I gave the implementation a try.
For me it works, I can use the AddSysctl flag with one or several entries and they will be passed to the container as expected.

@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 Sep 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants