From d1348b9898e27e6c8122bb76881beec9692f3285 Mon Sep 17 00:00:00 2001 From: Vladimir Zorin Date: Thu, 14 Mar 2019 14:12:02 +0200 Subject: [PATCH] Trim whitespaces before checking if line is empty or comment --- pkg/deploy/controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/deploy/controller.go b/pkg/deploy/controller.go index 1bf7dad2d5..6061c92cc2 100644 --- a/pkg/deploy/controller.go +++ b/pkg/deploy/controller.go @@ -254,8 +254,9 @@ func checksum(bytes []byte) string { func isEmptyYaml(yaml []byte) bool { isEmpty := true lines := bytes.Split(yaml, []byte("\n")) - for _, k := range lines { - if string(k) != "---" && !bytes.HasPrefix(k, []byte("#")) && string(k) != "" { + for _, l := range lines { + s := bytes.TrimSpace(l) + if string(s) != "---" && !bytes.HasPrefix(s, []byte("#")) && string(s) != "" { isEmpty = false } }