-
Notifications
You must be signed in to change notification settings - Fork 392
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
Don't reboot for GPG key changes #2824
Conversation
Skipping CI for Draft Pull Request. |
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.
you can also update the unit test when you're done:
func TestCalculatePostConfigChangeAction(t *testing.T) { |
@@ -54,6 +54,9 @@ const ( | |||
// Crio reload will happen when /etc/containers/registries.conf is changed. This will cause | |||
// a "systemctl reload crio" | |||
postConfigChangeActionReloadCrio = "reload crio" | |||
// GPGNoRebootPath is the path MCO expects will contain GPG key updates. MCO will attempt to only reload crio for | |||
// changes to this path. Note that other files added to the parent directory will not be handled specially | |||
GPGNoRebootPath = "/etc/machine-config-daemon/no-reboot/containers-gpg.pub" |
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.
Is it good to make paths like this public so the user could use it? Would it be good for us to use a const from the image repo for the policy.json
path? https://github.com/containers/image/blob/main/signature/policy_config.go#L38
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.
We can but I wouldn't worry about this much because implementation in OCP comes finally from container runtimeconfig controller and policy.json path is hard-coded there https://github.com/openshift/machine-config-operator/blob/master/pkg/controller/container-runtime-config/helpers.go#L38 . Also, I think OCP documentation will be referring to same path as well, so most likely it will not change unless advertised.
Hardcode paths to /etc/containers/policy.json and a path to update a GPG key that will only trigger a crio reload. Although long term it might be better to avoid hardcoding and implement admin defined reboot policies, for now this enables updating GPG keys with very little effort. Also added a helper function newFile to simplify testing calculatePostConfigChangeAction
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.
LGTM
Will let others review as well
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.
LGTM too
Just curious, how should this particular GPG key be used once on the system?
Note: Not Required to do in this PR, but a follow-up PR on updating doc with this change would be good. |
@yuqi-zhang I think the assumption is that the GPG key is only used by policy.json |
Will add lgtm by end of the day if there are no further questions/concerns. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkenigs, sinnykumari, yuqi-zhang 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 |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@mkenigs: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
10 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
No description provided.