Skip to content

Conversation

@MarSik
Copy link
Contributor

@MarSik MarSik commented Nov 12, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

This allows custom RuntimeHandlers to always inherit the default configured runtime paths. This helps with adding extra annotations or other "minor" changes while following what rest of the system does.

Which issue(s) this PR fixes:

Fixes #8753

Special notes for your reviewer:

This is a minimal proof of concept so I could test whether the configuration flow would make sense. I actually do not know if it covers all code paths.

Does this PR introduce a user-facing change?

A runtime handler definition in the configuration file can use a new option `use_default_runtime`. Setting it to true causes the values for runtime path, runtime type and runtime root to be inherited from the currently configured default runtime.

@MarSik MarSik requested a review from mrunalp as a code owner November 12, 2024 12:39
@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Nov 12, 2024
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 12, 2024
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 12, 2024

Hi @MarSik. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@codecov
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.68%. Comparing base (bc34150) to head (76049fe).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8754      +/-   ##
==========================================
+ Coverage   46.44%   46.68%   +0.23%     
==========================================
  Files         150      150              
  Lines       21946    22003      +57     
==========================================
+ Hits        10193    10271      +78     
+ Misses      10688    10666      -22     
- Partials     1065     1066       +1     

@kwilczynski
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 12, 2024
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Nov 14, 2024
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

We need to update docs/crio.conf.5.md and pkg/config/template.go. Please also fill the release-notes block in the body of this PR. Is it still WIP? :)

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 14, 2024
@MarSik MarSik changed the title WIP: RuntimeHandler inheritance RuntimeHandler inheritance Nov 14, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2024
@MarSik
Copy link
Contributor Author

MarSik commented Nov 14, 2024

@saschagrunert Like this?

@MarSik MarSik force-pushed the runtime-inherit branch 2 times, most recently from 249bcac to 3bb8942 Compare November 14, 2024 14:02
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Just a nit about the naming, otherwise LGTM


// Inheritance request
// Fill in the Runtime information (paths and type) from the default runtime
UseDefaultRuntime bool `toml:"use_default_runtime,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I'm just a bit concerned about the naming, how about inherit_default_options or similar? Maybe other @cri-o/cri-o-maintainers have other thoughts on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is inherit_default_runtime OK? Because it only replaces the runtime_* variables.

Copy link
Member

Choose a reason for hiding this comment

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

Probably, yes!

This allows defining a RuntimeHandler with custom
annotations or other fields while inheriting the
runtime type from the default runtime.

This behavior is useful for layered projects
that are not in control of the runtime selection
but need to tweak the specific behavior while
inheriting the node global runtime.

Signed-off-by: Martin Sivak <[email protected]>
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2024
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MarSik, saschagrunert

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2024
@saschagrunert
Copy link
Member

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit 9dc63d1 into cri-o:main Nov 15, 2024
70 checks passed
@saschagrunert
Copy link
Member

/cherry-pick release-1.31

@openshift-cherrypick-robot

@saschagrunert: new pull request created: #8762

In response to this:

/cherry-pick release-1.31

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Allow CRIO runtime handler to inherit default runtime binary and path from MCO configuration

4 participants