-
Notifications
You must be signed in to change notification settings - Fork 599
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
many: add default-configure hook #12701
many: add default-configure hook #12701
Conversation
1b5ee05
to
5e99685
Compare
5e99685
to
0480d37
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.
This looks very nice, one question inline and my other wondering is what it needs to go from "draft" to real review status :) ?
2b7e641
to
3b2cace
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, some now wondering about the behavior if the configure hook is missing
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, a comment about build time and validation in general
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, just one question about hook errors
e13319a
to
f53ef01
Compare
Spec: https://docs.google.com/document/d/1QDlVmTCtRAe0SxyvMZ97NlcosEtf1-MCmGcsRixDbek
Two parts:
(1) Implementation and unit tests: #12701 <- this is part 1
(2) Spread test: #12747
snap/hooktypes.go:
overlord/configstate/configmgr.go:
overlord/configstate/configstate.go:
DefaultConfigure
that provides the task set for the default configure hook. It is significantly simplified compared to the configure hook due to simpler mandate to configure snap with gadget defaults on first install for non-core snaps.overlord/configstate/hooks.go:
defaultConfigureHandler
with functions that satisfy the same interface asConfigureHandler
with Before, Error and Done.Before
to only apply defaults if default-configure is not available, otherwise "configuration empty change" as per specification.
Before
returns with error if there is not a configure hook so that "default-configure will be taken into account only if there is also a configure hook" as per specification.overlord/snapstate/check_snap.go:
overlord/snapstate/snapstate.go:
DefaultConfigure
after installation and right before service starting task.