Skip to content

Conversation

CowRules
Copy link

@CowRules CowRules commented Aug 23, 2025

Added a way to define default runtime flags in config.

Default runtime flags should be defined as shown below:

[engine.runtimes_flags]
runsc = [
  "net-raw",
]

crun = [
  "debug",
]

Fixes: containers/container-libs#91

This PR depends on containers/container-libs#281

Does this PR introduce a user-facing change?

Add Engine.runtimes_flags configuration option to containers.conf allowing users to specify default runtime flags for each runtime. Flags should be specified without '--' leading up to it.

Copy link
Contributor

openshift-ci bot commented Aug 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: CowRules
Once this PR has been reviewed and has the lgtm label, please assign ygalblum for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@CowRules CowRules marked this pull request as draft August 23, 2025 19:43
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 23, 2025
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@CowRules CowRules changed the title Add default runtime parameters in config Add default runtime flags in config Aug 24, 2025
Added a way to define default runtime flags in config.

Fixes: https://github.com/containers/common/issues/715

Default runtime flags should be defined as shown below:

[engine.runtimes_flags]
runsc = [
  "net-raw",
]

crun = [
  "debug",
]

Signed-off-by: Rosvaldas Atstupėnas <[email protected]>
@Luap99
Copy link
Member

Luap99 commented Sep 9, 2025

@CowRules Your config field change should be updated in podman already, so if you rebase this it should work now without the vendor changes.

@@ -453,6 +454,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *Buil
runtimeFlags = append(runtimeFlags, "--systemd-cgroup")
}

configIndex := libpod.RuntimeNameToConfigIndex(podmanConfig.RuntimePath)
Copy link
Member

Choose a reason for hiding this comment

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

you cannot import libpod into the remote client, this function would need to live elsewhere but really I would say just inline this

configIndex := libpod.RuntimeNameToConfigIndex(podmanConfig.RuntimePath)

for _, arg := range podmanConfig.ContainersConfDefaultsRO.Engine.OCIRuntimesFlags[configIndex] {
runtimeFlags = append(runtimeFlags, "--"+arg)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is right, compared to podmanConfig.RuntimeFlags this will always append. I would assume if we set --runtime-flag on the cli it should overwrite the config file and not always add as append?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: The runtime parameter can be defined when defining runtime
2 participants