Load ordinary overlays without a main source
This commit is contained in:
@@ -59,9 +59,24 @@ func loadSelectedOverlayIntoWithVersion(source Source, context *FilesystemContex
|
||||
}
|
||||
return loadSelectedOverlayWithAccessAndVersion(access, base, sources, name, rule, limits, versionState, policy)
|
||||
}
|
||||
rootPath, _, _, diagnostic := importFilesystem(source, context, main)
|
||||
if diagnostic != nil {
|
||||
return cloneSourceInfos(sources), []Diagnostic{*diagnostic}
|
||||
var rootPath string
|
||||
if source.kind == sourceNone {
|
||||
if context == nil {
|
||||
value := optionDiagnostic(CodeOptionsInvalid, "NoSource overlays require explicit filesystem context")
|
||||
return cloneSourceInfos(sources), []Diagnostic{value}
|
||||
}
|
||||
var err error
|
||||
rootPath, err = canonicalExistingPath(context.Root)
|
||||
if err != nil {
|
||||
value := importDiagnostic(CodeImportInvalid, "configuration root could not be canonicalized", nil)
|
||||
return cloneSourceInfos(sources), []Diagnostic{value}
|
||||
}
|
||||
} else {
|
||||
var diagnostic *Diagnostic
|
||||
rootPath, _, _, diagnostic = importFilesystem(source, context, main)
|
||||
if diagnostic != nil {
|
||||
return cloneSourceInfos(sources), []Diagnostic{*diagnostic}
|
||||
}
|
||||
}
|
||||
access, err := openHostAccess(rootPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user