Skip to content
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

WIP: Reload CRI-O configurations in particular order #7771

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SD-13
Copy link

@SD-13 SD-13 commented Feb 12, 2024

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #7586

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@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 Feb 12, 2024
Copy link
Contributor

openshift-ci bot commented Feb 12, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. 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 Feb 12, 2024
Copy link
Contributor

openshift-ci bot commented Feb 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: SD-13
Once this PR has been reviewed and has the lgtm label, please assign kolyshkin for approval. For more information see the Kubernetes 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

@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 Feb 12, 2024
Copy link
Contributor

openshift-ci bot commented Feb 12, 2024

Hi @SD-13. 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/test-infra repository.

@SD-13
Copy link
Author

SD-13 commented Feb 12, 2024

@kwilczynski I know it needs to be improved a lot and the code is little incomplete, but can you please take a look and let me know whether this is a good way of solving the bug? I feel like there is lots of boilerplate code. Can you please help in pointing out how it needs to be improved? Thanks!

@kwilczynski
Copy link
Member

@SD-13, the crux of the problem is definitely with the way how the configuration from multiple sources is applied against the current runtime configuration, especially following a reload request.

However, we shouldn't be parsing anything manually. We have a library that does this for us that we use.

Have a look at how configuration is parsed and then how the runtime configuration object is assembled. Then, look at how this path might differ when the reload is requested. Why is it different?

@SD-13
Copy link
Author

SD-13 commented Feb 27, 2024

Hey @kwilczynski I was having some health issues which caused the delay :)

I took a closer look and now not able to figure out how to update the config with the flagset. Let me try to break in down

However, we shouldn't be parsing anything manually. We have a library that does this for us that we use.

Here did you mean cli?

I tried to follow along and see here a flagset object is being created where command line argument values is being set as Value: ....
Here are we updating the config with the flagset values? Seems like this line tells something else which I don't understand clearly. Could you please explain how the flags are being set here to run the app?
btw, I started navigating from main.go.

Have a look at how configuration is parsed and then how the runtime configuration object is assembled. Then, look at how this path might differ when the reload is requested. Why is it different?

What did you mean by this path?

I am trying to do this and figuring out the first 2 cases -

if cmd args were set:
parse the flags and get the updated config
else if env vars were set:
parse the env vars and get the updated config
else if a file path was provided:
Use that as config
else
Use default config

Please take a look and let me know your thoughts on this. Thanks!

@SD-13
Copy link
Author

SD-13 commented Feb 29, 2024

@kwilczynski @saschagrunert Can you please help by pointing out where the default config is being overridden with the command line arguments. I am new to Go and getting lost while navigating.

@saschagrunert
Copy link
Member

@kwilczynski @saschagrunert Can you please help by pointing out where the default config is being overridden with the command line arguments.

Yes, this will happen here:

func mergeConfig(config *libconfig.Config, ctx *cli.Context) error {

@openshift-ci openshift-ci bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Feb 29, 2024
Signed-off-by: Sujay <sujaydey641@gmail.com>
@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 Feb 29, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 31, 2024
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. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reloading CRI-O configuration using SIGHUP overrides settings passed through command-line arguments
3 participants