mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Trim whitespaces before checking if line is empty or comment
This commit is contained in:
parent
567532d74d
commit
d1348b9898
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user