-
Notifications
You must be signed in to change notification settings - Fork 594
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
o/snapstate, o/devicestate: remodel with components from the store #14933
o/snapstate, o/devicestate: remodel with components from the store #14933
Conversation
fb52d67
to
7e4bd1c
Compare
Fri Jan 31 23:04:53 UTC 2025 Failures:Preparing:
Executing:
Restoring:
|
9d70ca3
to
f291bf0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14933 +/- ##
=========================================
Coverage ? 78.22%
=========================================
Files ? 1163
Lines ? 154159
Branches ? 0
=========================================
Hits ? 120597
Misses ? 26132
Partials ? 7430
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
snapsupTask = t | ||
break | ||
} | ||
t := ts.MaybeEdge(snapstate.SnapSetupEdge) |
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.
@pedronis here is where the new edge is used
f291bf0
to
8acd511
Compare
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.
sorry, only couple of trivials first
summary: create a recovery system with a kernel module component and reboot into it | ||
|
||
details: | | ||
This test creates a recovery system with a kernel module component and | ||
validates that the newly created system can be rebooted into. |
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.
summary and description sound off as they don't mention remodel?
overlord/devicestate/devicestate.go
Outdated
return nil, nil, err | ||
} | ||
|
||
if !snapsup.ComponentExclusiveSetup { |
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.
hasn't this been renamed?
8acd511
to
0dd1396
Compare
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.
did a pass
overlord/devicestate/devicestate.go
Outdated
default: | ||
// nothing to do but add the snap to the prereq tracker | ||
r.tracker.Add(currentInfo) | ||
return remodelNoAction, nil, nil | ||
} | ||
} | ||
|
||
func (r *remodeler) shouldJustSwitch(rt remodelSnapTarget, needsRevisionChange bool) bool { | ||
func (r *remodeler) shouldSwitchWithoutRefresh(rt remodelSnapTarget, needsRevisionChange bool, needsComponentChanges bool) bool { |
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 not entirely sure if passing needsComponentChanges is more readable than checking it outside of the helper
overlord/devicestate/devicestate.go
Outdated
requiredComponents = append(requiredComponents, c) | ||
} | ||
} | ||
} |
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.
maybe the two loops to compute needsComponentChanges and update requiredCompontents should be a helper?
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.
Pushed 9c30418. Name of function might need some work.
@@ -563,7 +616,18 @@ func (r *remodeler) maybeInstallOrUpdate(ctx context.Context, st *state.State, r | |||
return remodelChannelSwitch, []*state.TaskSet{ts}, nil | |||
} | |||
|
|||
goal, err := r.updateGoal(st, rt, constraints) | |||
// right now, we don't properly handle switching a channel and |
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.
do we have a test for that combo though?
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.
Added one in 909780f.
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.
thank you
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, some minor things
exit | ||
fi | ||
|
||
snap install test-snapd-swtpm --edge |
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.
Isn't this installed by nested_start_core_vm_unit()
?
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.
It is, but it won't work there since we've already set up the fake store at that point. I'll add 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.
LGTM, thanks for the changes
e158aaf
to
fddca0c
Compare
Only required failure is |
a7744b5
to
44cc1d2
Compare
This change enables us to do a remodel that includes components from the store. This is a little incomplete, as I discovered that I need to handle the case where we swap to an already installed kernel (leftover from a previous remodeling) that may have some components already installed. This is a small edge case, and will not change most of the PR.
Based on #14939 for now.