From 945e8de0a303658850351b63f6b6260d18fa65e8 Mon Sep 17 00:00:00 2001 From: Haitham Rageh Date: Tue, 19 Nov 2024 07:11:54 +0200 Subject: [PATCH] handle empty stack yaml file configuration (#791) * fix: handle empty stack YAML configuration and adjust file content retrieval * fix: return existing content from GetFileContent instead of an empty string * fix: remove unnecessary blank lines in ProcessYAMLConfigFile and GetFileContent functions --- examples/demo-localstack/stacks/deploy/footbar.yaml | 0 internal/exec/stack_processor_utils.go | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 examples/demo-localstack/stacks/deploy/footbar.yaml diff --git a/examples/demo-localstack/stacks/deploy/footbar.yaml b/examples/demo-localstack/stacks/deploy/footbar.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/internal/exec/stack_processor_utils.go b/internal/exec/stack_processor_utils.go index b6c6f4d0e..b616e2348 100644 --- a/internal/exec/stack_processor_utils.go +++ b/internal/exec/stack_processor_utils.go @@ -199,6 +199,9 @@ func ProcessYAMLConfigFile( return nil, nil, nil, err } } + if stackYamlConfig == "" { + return map[string]any{}, map[string]map[string]any{}, map[string]any{}, nil + } stackManifestTemplatesProcessed := stackYamlConfig stackManifestTemplatesErrorMessage := ""