8000 [release-1.33] server,factory/container: delay CDI device injection later. by klihub · Pull Request #9295 · cri-o/cri-o · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[release-1.33] server,factory/container: delay CDI device injection later. #9295

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

Open
wants to merge 3 commits into
base: release-1.33
Choose a base branch
from

Conversation

klihub
Copy link
Contributor
@klihub klihub commented Jun 27, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

Currently CDI device injection is performed right after injecting other devices into the container. This is problematic because CDI device injection might alter, among other things, the environment. However setting up the final environment happens only later during container creation and it involves setting environment variables from the image and the Pod Spec. If the same environment variable is injected both from an image or a container, and from a CDI Spec, now the former take precedence of the latter. This is unintentional and wrong.

This patch moves CDI device injection much later during container creation, between OCI Hook injection and *oci.Container creation.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

server: delay CDI device injection, to ensure that CDI Spec edits take precedence over image defaults and the Pod Spec.

@klihub klihub requested a review from mrunalp as a code owner June 27, 2025 19:52
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. labels Jun 27, 2025
@openshift-ci openshift-ci bot requested review from hasan4791 and littlejawa June 27, 2025 19:52
Copy link
Contributor
openshift-ci bot commented Jun 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: klihub
Once this PR has been reviewed and has the lgtm label, please assign kolyshkin 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

@klihub klihub force-pushed the fixes/release-1.33/delay-cdi-device-injection branch 2 times, most recently from 03baca8 to d4cde08 Compare June 27, 2025 20:22
Copy link
codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 47.45%. Comparing base (0da1b7c) to head (7def266).

Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.33    #9295      +/-   ##
================================================
- Coverage         47.45%   47.45%   -0.01%     
================================================
  Files               162      162              
  Lines             24060    24063       +3     
================================================
  Hits              11418    11418              
- Misses            11524    11526       +2     
- Partials           1118     1119       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

klihub added 3 commits July 3, 2025 11:18
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Use a few environment variables with default values to verify
that evironment variables from CDI injection take precedence
over ones in the Pod Spec.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Currently CDI device injection is performed right after injecting
other devices into the container. This is problematic because CDI
device injection might alter, among other things, the environment.
However setting up the final environment happens only later during
container creation and it involves setting environment variables
from the image and the Pod Spec. If the same environment variable
is injected both from an image or a container, and from a CDI Spec,
now the former take precedence of the latter. This is unintentional
and wrong.

This patch moves CDI device injection much later during container
creation, between OCI Hook injection and *oci.Container creation.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub klihub force-pushed the fixes/release-1.33/delay-cdi-device-injection branch from d4cde08 to 7def266 Compare July 3, 2025 08:23
@klihub
Copy link
Contributor Author
klihub commented Jul 3, 2025

@haircommander This is a cherry-pick/backport of #9292 to the 1.33 release branch. If we don't suspect those CI failures to be related to the changes this PR brings in, could we get this in ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0