Derive selected overlay context from the main input

This commit is contained in:
2026-11-09 20:40:40 +00:00
parent b93cbb0639
commit 761dd0a4e0
4 changed files with 91 additions and 9 deletions

View File

@@ -29,11 +29,12 @@ func validOverlayName(name string) bool {
}
type selectedOverlayRequest struct {
name string
protectionRule *VersionRule
sequencePolicy sequencePolicy
limits importLimits
versionState *sourceVersionState
name string
lookupDirectory string
protectionRule *VersionRule
sequencePolicy sequencePolicy
limits importLimits
versionState *sourceVersionState
}
func resolveOrdinaryOverlayFilesystem(source Source, context *FilesystemContext, main parsedSource, existing *resolvedFilesystemContext) (resolvedFilesystemContext, *Diagnostic) {
@@ -70,7 +71,11 @@ func loadSelectedOverlay(request selectedOverlayRequest, access *filesystemAcces
_ = access.close()
}
}()
overlayPath := access.join(access.rootPath, "overlays/"+request.name+".yml")
lookupDirectory := request.lookupDirectory
if lookupDirectory == "" {
lookupDirectory = access.rootPath
}
overlayPath := access.join(lookupDirectory, "overlays/"+request.name+".yml")
canonical, err := access.canonical(overlayPath)
if err != nil {
code := CodeOverlayInvalid