Integrate private destinations for layered inputs
This commit is contained in:
@@ -17,9 +17,10 @@ type loadRequest[T any] struct {
|
||||
}
|
||||
|
||||
type loadInput struct {
|
||||
source Source
|
||||
imports bool
|
||||
filesystem *FilesystemContext
|
||||
source Source
|
||||
imports bool
|
||||
filesystem *FilesystemContext
|
||||
destination Path
|
||||
}
|
||||
|
||||
type loadGroup struct{ inputs []loadInput }
|
||||
@@ -27,12 +28,23 @@ type loadGroup struct{ inputs []loadInput }
|
||||
func loadGroupedWithSecretLookup[T any](request loadRequest[T], secrets SecretBinding, lookup secretLookup) (*Loaded[T], error) {
|
||||
request.ordinary = false
|
||||
var diagnostics []Diagnostic
|
||||
if normalized, err := normalizeDestination(request.main.destination); err != nil {
|
||||
diagnostics = append(diagnostics, invalidDestinationDiagnostic(request.main.destination))
|
||||
} else {
|
||||
request.main.destination = normalized
|
||||
}
|
||||
_, mainDiagnostics := selectOptions(request.main.source, []Options[T]{{
|
||||
Definition: request.definition, Imports: request.main.imports, Filesystem: request.main.filesystem,
|
||||
}})
|
||||
diagnostics = append(diagnostics, mainDiagnostics...)
|
||||
for _, group := range request.underlays {
|
||||
for _, input := range group.inputs {
|
||||
for groupIndex := range request.underlays {
|
||||
for inputIndex := range request.underlays[groupIndex].inputs {
|
||||
input := &request.underlays[groupIndex].inputs[inputIndex]
|
||||
if normalized, err := normalizeDestination(input.destination); err != nil {
|
||||
diagnostics = append(diagnostics, invalidDestinationDiagnostic(input.destination))
|
||||
} else {
|
||||
input.destination = normalized
|
||||
}
|
||||
_, inputDiagnostics := selectOptions(input.source, []Options[T]{{Imports: input.imports, Filesystem: input.filesystem}})
|
||||
diagnostics = append(diagnostics, inputDiagnostics...)
|
||||
}
|
||||
@@ -134,7 +146,7 @@ func acquireUnderlayGroup(group loadGroup, index int, rule *VersionRule, account
|
||||
var contexts map[string]ResourceContext
|
||||
for _, contribution := range group.inputs {
|
||||
options := Options[struct{}]{Imports: contribution.imports, Filesystem: contribution.filesystem, Definition: Definition[struct{}]{Version: rule}}
|
||||
acquired, diagnostics := assembleBaseInputTracked(contribution.source, options, accounting, visited, hostToken)
|
||||
acquired, diagnostics := assembleBaseInputTracked(contribution.source, options, contribution.destination, accounting, visited, hostToken)
|
||||
for _, source := range acquired.sources {
|
||||
source.Layer = LayerUnderlay
|
||||
source.UnderlayIndex = index
|
||||
|
||||
Reference in New Issue
Block a user