Skip to content

Commit 3feb046

Browse files
committed
feat(planstate): add extension support
1 parent 62c200b commit 3feb046

File tree

3 files changed

+491
-1
lines changed

3 files changed

+491
-1
lines changed

internals/overlord/planstate/manager.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ func NewManager(layersDir string) (*PlanManager, error) {
4848
return manager, nil
4949
}
5050

51+
// RegisterExtension adds a plan extension which extends the plan schema. All
52+
// extensions must be registered before Load() is called.
53+
func (m *PlanManager) RegisterExtension(field string, ext plan.LayerSectionExtension) {
54+
plan.RegisterExtension(field, ext)
55+
}
56+
5157
// Load reads plan layers from the pebble directory, combines and validates the
5258
// final plan, and finally notifies registered managers of the plan update. In
5359
// the case of a non-existent layers directory, or no layers in the layers
@@ -181,6 +187,7 @@ func (m *PlanManager) updatePlanLayers(layers []*plan.Layer) (*plan.Plan, error)
181187
Services: combined.Services,
182188
Checks: combined.Checks,
183189
LogTargets: combined.LogTargets,
190+
Sections: combined.Sections,
184191
}
185192
err = p.Validate()
186193
if err != nil {

0 commit comments

Comments
 (0)