Derive selected overlay context from the main input
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user