Apply CLI overrides after typed decoding
This commit is contained in:
@@ -287,7 +287,7 @@ func registerAcquiredSource(source Source, context *FilesystemContext, info *Sou
|
||||
}
|
||||
|
||||
func applyInputLayers[T any](source Source, options Options[T], input assembledInput) (assembledInput, []Diagnostic) {
|
||||
if !activeOverlay(options.Overlay) && len(options.Overrides) == 0 {
|
||||
if !activeOverlay(options.Overlay) {
|
||||
return input, nil
|
||||
}
|
||||
composition, diagnostics := compositionForInputWithPolicy(input, options.sequencePolicy)
|
||||
@@ -309,21 +309,13 @@ func applyInputLayers[T any](source Source, options Options[T], input assembledI
|
||||
}
|
||||
mergeResourceContexts(&input.contexts, contexts)
|
||||
}
|
||||
if len(options.Overrides) != 0 {
|
||||
input.sources, diagnostics = assembly.applyOverrides(
|
||||
input.sources, options.Overrides, options.Definition.Version, defaultImportLimits(),
|
||||
)
|
||||
if len(diagnostics) != 0 {
|
||||
return input, diagnostics
|
||||
}
|
||||
}
|
||||
input.composition = assembly.current
|
||||
input.document = assembly.current.root
|
||||
return input, nil
|
||||
}
|
||||
|
||||
// compositionForInput initializes one handoff for overlays and CLI, including
|
||||
// defaults-only CLI input. Raw source bytes and mapping keys retain their budgets.
|
||||
// compositionForInput initializes the structural handoff used by inheritance
|
||||
// expansion. Raw source bytes and mapping keys retain their budgets.
|
||||
func compositionForInput(input assembledInput) (*composedDocument, []Diagnostic) {
|
||||
return compositionForInputWithPolicy(input, sequencePolicy{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user