-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow runtimes to be added and default runtime to be modified on config reload #6056
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
Conversation
|
Hi @elezar. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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/test-infra repository. |
|
The code LGTM for what you're intending to do. However, I'll have to lean on @giuseppe , @haircommander and @saschagrunert on the safeness of swapping out the runtime like this. |
|
/ok-to-test thanks @elezar ! I have a couple of notes, but this is definitely in the right direction |
Note that this only adds new runtimes and does not replace existing ones. The exception is that the name of the default runtime can be changed. Any insights into caveats here would be appreciated. |
pkg/config/config.go
Outdated
| // check we do have at least a runtime | ||
| if _, ok := c.Runtimes[c.DefaultRuntime]; !ok { | ||
| // Set the default runtime to "runc" if default_runtime is not set | ||
| if c.DefaultRuntime == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, can we invert this condition and compress the else?
if c.DefaultRuntime != "" { return } ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this was already there, but doesn't hurt to update now 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I have updated this in 493eb02
saschagrunert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit test failures may be legit. Can we also add a test to https://github.com/cri-o/cri-o/blob/main/test/reload_config.bats, maybe by injecting a fake runtime?
OK. I will have a look. |
main is currently feeding into 1.26, so 4.13 would be the target @saschagrunert PTAL |
saschagrunert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny error wrapping nit, otherwise LGTM
pkg/config/reload.go
Outdated
| } | ||
|
|
||
| if err := c.ValidateRuntimes(); err != nil { | ||
| return fmt.Errorf("unabled to reload runtimes: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return fmt.Errorf("unabled to reload runtimes: %v", err) | |
| return fmt.Errorf("unabled to reload runtimes: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will rebase and make this change tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and rebased.
c5b6e2f to
90e7bff
Compare
|
/retest-required |
|
thanks for your patience as we went through a CI migration and multiple outages /lgtm |
|
oh bother |
|
/retest |
|
/hold cancel |
Since we want to validate the default runtime separately when reloading the runtime config we factor out default runtime validation into a ValidateDefaultRuntime method. Signed-off-by: Evan Lezar <[email protected]>
This change cleans up the conditional checks in ValidateDefaultRuntime for readability. Signed-off-by: Evan Lezar <[email protected]>
This change includes the update of runtime configs on a config reload. This is currently limited to: * Changing the default runtime * Adding new runtimes Signed-off-by: Evan Lezar <[email protected]>
Signed-off-by: Evan Lezar <[email protected]>
Signed-off-by: Evan Lezar <[email protected]>
90e7bff to
9db3e8e
Compare
|
/retest |
|
@haircommander thanks for giving me the heads-up regarding the CI issues. I have rebased the changes off |
|
yeah that one is expected /override ci/prow/ci-e2e-conmonrs |
|
@haircommander: Overrode contexts on behalf of haircommander: ci/prow/ci-e2e-conmonrs DetailsIn response to this:
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/test-infra repository. |
|
@elezar: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support for reloading runtime configs on SIGHUP. This allows for runtimes to be added dynamically and the default runtimes to be adjusted.
This is useful for cases where runtimes are added / configured after crio is started. One example of this is the NVIDIA Container Runtime which is managed by the NVIDIA GPU Operator. Without this change, adding a runtime to the config requires a node restart which is disruptive.
Which issue(s) this PR fixes:
Fixes #6036
Special notes for your reviewer:
Does this PR introduce a user-facing change?