-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/support resolve variable references #351
Feature/support resolve variable references #351
Conversation
…for local references
…for lookup references
…for module references
…for variable references
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
==========================================
- Coverage 63.78% 61.42% -2.37%
==========================================
Files 66 72 +6
Lines 1378 1602 +224
==========================================
+ Hits 879 984 +105
- Misses 419 532 +113
- Partials 80 86 +6
|
|
||
// create output.ResourceConfig from hclConfigs.Resource | ||
resourceConfig, err := CreateResourceConfig(managedResource) | ||
if err != nil { | ||
return allResourcesConfig, fmt.Errorf("failed to create ResourceConfig") | ||
} | ||
|
||
// resolve references |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a variable cannot be resolved, does this now cause an error? i think it would be preferable to continue processing while ignoring any missing vars.
lookup := r.ResolveStrRef(table) | ||
|
||
// check if lookup is a map | ||
if reflect.TypeOf(lookup).String() != "map[string]interface {}" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use a type assertion here like in the next if statement?
case vType == "[]interface {}" && vKind == reflect.Slice: | ||
|
||
// case 3: config value is a []interface{} | ||
sConfig, ok := v.([]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a redundant check
No description provided.