fix: respect OCIRuntime field in SpecGenerator#28473
Closed
GiulioSavini wants to merge 1 commit intocontainers:mainfrom
Closed
fix: respect OCIRuntime field in SpecGenerator#28473GiulioSavini wants to merge 1 commit intocontainers:mainfrom
GiulioSavini wants to merge 1 commit intocontainers:mainfrom
Conversation
205eb76 to
455e393
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
2 similar comments
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
33bd529 to
c7ced45
Compare
When creating containers via the API with OCIRuntime set in the SpecGenerator, the field was silently ignored and the default runtime from containers.conf was used instead. The code only considered the image-platform-based runtime selection but never checked s.OCIRuntime. Now the user's explicit OCIRuntime choice takes priority over the automatic image-platform-based selection, falling back to the existing behavior when not set. Includes a regression test that verifies the oci_runtime field is respected when creating containers via the API. Fixes containers#28429 Signed-off-by: giulio.savini <giulio.savini@bvtech.com>
c7ced45 to
1dc18e3
Compare
Member
|
There is already someone working on this in #28454, please do not work on issues that already have open PRs and rather review them if you are interest in that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When creating containers via the API with
OCIRuntimeset in the SpecGenerator, the field was silently ignored. The container always used the default runtime fromcontainers.confinstead of the one specified in the API request.The issue is in
pkg/specgen/generate/container_create.goat line 168: the code only considered the image-platform-based runtime selection (ImagePlatformToRuntime) but never checkeds.OCIRuntime.Changes
The fix gives the user's explicit
OCIRuntimechoice priority over the automatic image-platform-based selection, and falls back to the existing behavior when not set:This is consistent with how the CLI
--runtimeflag works, which correctly passes the runtime through.Test plan
OCIRuntimeset to a non-default runtimeOCIRuntimeset — verify existing behavior unchanged--runtimeCLI flag still works as beforeFixes #28429