-
Notifications
You must be signed in to change notification settings - Fork 462
Factor out functionality from update() that will be needed for layering #2987
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
Factor out functionality from update() that will be needed for layering #2987
Conversation
pkg/daemon/update.go
Outdated
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.
Are these comments out of date? Or am I misunderstanding how error handling works here? It looks like it just returns errors
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 think you're right that those bits got moved out? Though honestly I am having trouble following all of the flow.
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.
Ah yeah I think I did that here: d200340
Without properly updating the comment
7667b1e to
47d9151
Compare
|
/test e2e-gcp-op |
|
/test e2e-gcp-op |
|
/test e2e-gcp-op |
f7985d4 to
1b8e874
Compare
|
/test e2e-gcp-op |
1b8e874 to
4da81ce
Compare
|
e2e-gcp-op hit the total test timeout, but I had a passing run before a minor change so don't expect there's an actual problem |
cgwalters
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.
Overall looks sane to me; I am a bit less confident in the later changes just because of the complexity of the code. But, I think a lot of this is covered by our e2es.
pkg/daemon/update.go
Outdated
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.
(Unrelated to your PR, but this appears to be another instance where actually what we want to test is "rhel8 vs rhel9 vs fedora N", not "fcos vs rhcos"; xref coreos/fedora-coreos-config#1405 (comment) etc.)
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 was thinking about this as well.
pkg/daemon/drain.go
Outdated
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.
This looks totally fine to me as is, but I'm thinking we may want to make this an interface in the future?
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.
pkg/daemon/update.go
Outdated
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 think you're right that those bits got moved out? Though honestly I am having trouble following all of the flow.
pkg/controller/common/constants.go
Outdated
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.
Probably worth converting at least one user in this commit.
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.
Converted almost everything
4da81ce to
b649419
Compare
cheesesashimi
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.
I just have a couple minor questions and suggestions.
pkg/daemon/update.go
Outdated
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 was thinking about this as well.
yuqi-zhang
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.
Some minor comments. I think it would be helpful for me at least if I can understand why some of these refactors are needed, for example:
- Why does calculatePostConfigChangeAction need to be consolidated?
- What is the extra FCOS checks added for?
- Why do we need to move isDrainRequired -> drainIfRequired
As a counter example, the explanation around readFileFunc is very nice
pkg/daemon/update.go
Outdated
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.
Ah yeah I think I did that here: d200340
Without properly updating the comment
pkg/daemon/update.go
Outdated
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'm a bit confused at the use of skipReboot here. This is only for onceFrom right? Why is this specifically handled here?
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 missed adding this condition originally and it was causing bootstrap to fail. Looking at the old version of performPostConfigChangeAction it calls dn.reboot which I initially assumed would never return. But if dn.skipReboot == true, dn.reboot does return, and performPostConfigChangeAction returns early before updating state. So I had to add this to preserve that behavior. I can't say I fully understand why that's necessary because how state is managed is pretty unclear to me
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.
Overall, this PR is a bit overreaching. While it's a "prep" pr, it has some more trivial changes that are easy to merge for ex namespace constant but then other parts that are much less trivial and need more review/discussion/understanding/explanation. I think combining them all into one PR makes for difficult review and discussion and think we should consider breaking this PR up a bit (for ex along the lines of Jerry's questions above could be a start).
b649419 to
1458d39
Compare
Added a much more detailed commit message (c4b5dcf) Does that clear it up?
The path for ssh keys is different on FCOS. Some of the explanation I added in the commit message should give some more context
Per @cheesesashimi 's feedback I just wrote a wrapper function. I'm just anticipating de-duplicating between legacy and layered update. |
|
Per @kikisdeliveryservice's comments have opened: |
|
Will wait for other PRs to merge before revisiting commits left here |
1458d39 to
c1901f1
Compare
c1901f1 to
a124451
Compare
This code will be needed for layered updates
isDrainRequired needs to support multiple types of file content, since layered updates will require ostree cat'ing a file while legacy updates read the contents directly from MachineConfigs. This is accomplished by passing isDrainRequired functions to read content from old and new files
This code will be needed for layered updates
Layered updates will only need to perform post config change actions. Comments about uncordoning the node and rebooting immediately were dropped as they have been out of date since d200340
a124451 to
c1529b3
Compare
|
@kikisdeliveryservice is this small enough now or should I split it again? |
|
@mkenigs: 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. |
|
/hold cancel |
|
Since this is targeting layering, I don't see any blockers to merge. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, mkenigs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick master |
|
@mkenigs: #2987 failed to apply on top of branch "master": 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. |
Various refactors that will be helpful for sharing functionality between a legacy and layering update flow. Opening this against
masterper discussion in #2982 (comment). I would like to get a CI run because I'm having trouble launching a cluster with code we're trying to get intolayering