From 2d0f9f02cd02f9b155d12314662ef2634994fe3f Mon Sep 17 00:00:00 2001 From: Felipe Avelar Date: Mon, 12 Apr 2021 11:12:27 +0100 Subject: [PATCH] Added log when terraform.tfvars not found Signed-off-by: Felipe Avelar --- pkg/parser/terraform/variables.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/parser/terraform/variables.go b/pkg/parser/terraform/variables.go index aa29e82576c..061c94e7f4e 100644 --- a/pkg/parser/terraform/variables.go +++ b/pkg/parser/terraform/variables.go @@ -115,7 +115,10 @@ func getInputVariables(currentPath string) { log.Error().Msg("Error getting .auto.tfvars files") } - if _, err := os.Stat(filepath.Join(currentPath, "terraform.tfvars")); err == nil { + _, err = os.Stat(filepath.Join(currentPath, "terraform.tfvars")) + if err != nil { + log.Info().Msg("terraform.tfvars not found") + } else { tfVarsFiles = append(tfVarsFiles, filepath.Join(currentPath, "terraform.tfvars")) }