From 8a523ad6394d340f2f07ddd3686bff0565fe9a3c Mon Sep 17 00:00:00 2001 From: Yusuf Kanchwala Date: Wed, 7 Oct 2020 10:58:23 +0530 Subject: [PATCH] update debug log messages --- pkg/iac-providers/terraform/v12/references.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/iac-providers/terraform/v12/references.go b/pkg/iac-providers/terraform/v12/references.go index 244bb7014..482405231 100644 --- a/pkg/iac-providers/terraform/v12/references.go +++ b/pkg/iac-providers/terraform/v12/references.go @@ -100,9 +100,6 @@ func (r *RefResolver) ResolveRefs(config jsonObj) jsonObj { sConfig[i] = r.ResolveRefs(c) } config[k] = sConfig - - } else { - zap.S().Debugf("cannot resolve refs for var: '%v', type '%v', kind: '%v',\nvalue: '%v'", k, reflect.TypeOf(v), valKind, v) } } @@ -146,6 +143,7 @@ func (r *RefResolver) getVarValueFromParentModuleCall(varRef string) (interface{ if err != nil { return varRef, false } + zap.S().Debugf("resolved variable reference from module call; var ref: '%v', value: '%v', type: '%v'", varRef, val, reflect.TypeOf(val)) // replace the variable reference string with actual value if reflect.TypeOf(val).Kind() == reflect.String { @@ -189,6 +187,8 @@ func (r *RefResolver) getVarValue(varRef string) (interface{}, bool) { // based on cty.Type, determine golang type for _, converter := range ctyConverterFuncs { if val, err := converter(hclVar.Default); err == nil { + zap.S().Debugf("resolved variable reference; var ref: '%v', value: '%v', type: '%v'", varRef, val, reflect.TypeOf(val)) + // replace the variable reference string with actual value if reflect.TypeOf(val).Kind() == reflect.String { valStr := val.(string)