Skip to content

Commit d707014

Browse files
authored
feat: pass through metadata generate requirements errors (#3142)
1 parent 36af51c commit d707014

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cli/bpmetadata/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func CreateBlueprintMetadata(bpPath string, bpMetadataObj *BlueprintMetadata) (*
268268
moduleName := parseBpModuleName(bpPath, repoDetails.Source.BlueprintRootPath)
269269
requirements, err := getBlueprintRequirements(rolesCfgPath, svcsCfgPath, versionsCfgPath, mdFlags.perModuleRequirements, moduleName)
270270
if err != nil {
271-
Log.Info("skipping blueprint requirements since roles and/or services configurations were not found as per https://tinyurl.com/tf-iam and https://tinyurl.com/tf-services")
271+
Log.Info("skipping blueprint requirements since roles and/or services configurations were not found as per https://tinyurl.com/tf-iam and https://tinyurl.com/tf-services", "error:", err)
272272
} else {
273273
bpMetadataObj.Spec.Requirements = requirements
274274
}

cli/bpmetadata/tfconfig.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import (
2323
)
2424

2525
const (
26-
versionRegEx = "/v([0-9]+[.0-9]*)$"
27-
modulePattern = `(?:^|/)modules/([^/]+)`
28-
perModuleRoles = "per_module_roles"
26+
versionRegEx = "/v([0-9]+[.0-9]*)$"
27+
modulePattern = `(?:^|/)modules/([^/]+)`
28+
perModuleRoles = "per_module_roles"
2929
perModuleServices = "per_module_services"
30-
rootModuleName = "root"
30+
rootModuleName = "root"
3131
)
3232

3333
type blueprintVersion struct {
@@ -509,7 +509,7 @@ func parseBlueprintServices(servicesFile *hcl.File, perModuleMode bool, moduleNa
509509
diags = gohcl.DecodeExpression(apisAttr.Expr, nil, &s)
510510
err = hasHclErrors(diags)
511511
if err != nil {
512-
return nil, err
512+
return nil, fmt.Errorf("error decoding activate_apis: %w", err)
513513
}
514514

515515
// because we're only interested in the top-level modules block

0 commit comments

Comments
 (0)