mirror of
https://github.com/turbot/steampipe.git
synced 2026-03-24 11:00:34 -04:00
18 lines
581 B
Go
18 lines
581 B
Go
package modconfig
|
|
|
|
import "github.com/turbot/go-kit/helpers"
|
|
|
|
// we cannot use the Base directly as decoded as the runtime dependencies and resource metadata
|
|
// are not stored in the evaluation context
|
|
// instead, resolve the base from the run context (passed as a ModResourcesProvider)
|
|
func resolveBase(base HclResource, resourceMapProvider ModResourcesProvider) (HclResource, bool) {
|
|
if helpers.IsNil(base) {
|
|
return nil, false
|
|
}
|
|
parsedName, err := ParseResourceName(base.Name())
|
|
if err != nil {
|
|
return nil, false
|
|
}
|
|
return GetResource(resourceMapProvider, parsedName)
|
|
}
|