mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
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 <dougsland@redhat.com>
This commit is contained in:
parent
d73693cb44
commit
722751accf
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user