From 722751accf7607f4d0573778e85027c63e1802ce Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Mon, 18 Jan 2021 23:22:36 -0500 Subject: [PATCH] kubectl diff: update regex to allow equal param When using GNU diffutils, some commands (e.g. --color[=WHEN]) requires an equal sign. Signed-off-by: Douglas Schilling Landgraf --- staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go b/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go index 74984350648..d2045c2cb18 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go @@ -177,8 +177,8 @@ func (d *DiffProgram) getCommand(args ...string) (string, exec.Cmd) { diff = diffCommand[0] if len(diffCommand) > 1 { - // Regex accepts: Alphanumeric (case-insensitive) and dash - isValidChar := regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString + // Regex accepts: Alphanumeric (case-insensitive), dash and equal + isValidChar := regexp.MustCompile(`^[a-zA-Z0-9-=]+$`).MatchString for i := 1; i < len(diffCommand); i++ { if isValidChar(diffCommand[i]) { args = append(args, diffCommand[i])