Merge pull request #98158 from dougsland/kubectlExternalDiff

kubectl diff: update regex to allow equal sign
This commit is contained in:
Kubernetes Prow Robot 2021-01-20 08:46:12 -08:00 committed by GitHub
commit ab21bdba89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,8 +177,8 @@ func (d *DiffProgram) getCommand(args ...string) (string, exec.Cmd) {
diff = diffCommand[0] diff = diffCommand[0]
if len(diffCommand) > 1 { if len(diffCommand) > 1 {
// Regex accepts: Alphanumeric (case-insensitive) and dash // Regex accepts: Alphanumeric (case-insensitive), dash and equal
isValidChar := regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString isValidChar := regexp.MustCompile(`^[a-zA-Z0-9-=]+$`).MatchString
for i := 1; i < len(diffCommand); i++ { for i := 1; i < len(diffCommand); i++ {
if isValidChar(diffCommand[i]) { if isValidChar(diffCommand[i]) {
args = append(args, diffCommand[i]) args = append(args, diffCommand[i])