From 1403f9b19802ad6fe01993c294ff9b0c245dcbce Mon Sep 17 00:00:00 2001 From: adrian-salas Date: Sun, 22 May 2022 22:52:07 +0200 Subject: [PATCH] ISSUE-13 - Ignore comment prefix in envfiles (#15) Co-authored-by: Adrian SALAS fix #13 --- helm/configAndSecretMap.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/configAndSecretMap.go b/helm/configAndSecretMap.go index 86ff0b7..e3e7b47 100644 --- a/helm/configAndSecretMap.go +++ b/helm/configAndSecretMap.go @@ -50,8 +50,10 @@ func (c *ConfigMap) AddEnvFile(file string) error { lines := strings.Split(string(content), "\n") for _, l := range lines { + //Check if the line is a comment + isComment := strings.HasPrefix(l, "#") l = strings.TrimSpace(l) - if len(l) == 0 { + if len(l) == 0 || isComment { continue } parts := strings.SplitN(l, "=", 2)