mirror of
https://github.com/rancher/types.git
synced 2025-07-19 15:56:26 +00:00
fix regular expression
https://github.com/rancher/rancher/issues/14939. Problems: we are not using lazy match to match the group (!=|=) so that "foo != bar` can be parsed wrongly as (foo !) (=) (bar). Solutions: Use lazy match to match as less as possible the characters in the first group. Also improved the whitespace matches.
This commit is contained in:
parent
d919b35add
commit
0968d09296
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
exprRegexp = regexp.MustCompile("^(.*)(=|!=|<|>| in | notin )(.*)$")
|
||||
exprRegexp = regexp.MustCompile("^(.*?)\\s*(=|!=|<|>|in|notin)\\s*(.*)$")
|
||||
)
|
||||
|
||||
type SchedulingMapper struct {
|
||||
|
Loading…
Reference in New Issue
Block a user