From 0198d9185ed7a6766be9908b7579ac6581added1 Mon Sep 17 00:00:00 2001 From: yylt Date: Thu, 21 Oct 2021 20:07:38 +0800 Subject: [PATCH] Fix edit command Kubernetes-commit: 2ae37c8046128e0191ec96c8b31361ae894f2330 --- pkg/cmd/util/helpers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/util/helpers.go b/pkg/cmd/util/helpers.go index a2751d4d..f82b1935 100644 --- a/pkg/cmd/util/helpers.go +++ b/pkg/cmd/util/helpers.go @@ -725,7 +725,9 @@ func ManualStrip(file []byte) []byte { stripped := []byte{} lines := bytes.Split(file, []byte("\n")) for i, line := range lines { - if bytes.HasPrefix(bytes.TrimSpace(line), []byte("#")) { + trimline := bytes.TrimSpace(line) + + if bytes.HasPrefix(trimline, []byte("#")) && !bytes.HasPrefix(trimline, []byte("#!")) { continue } stripped = append(stripped, line...)