mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
Merge pull request #127375 from omerap12/issue_126311
Add test for CEL reserved symbols without double underscore
This commit is contained in:
commit
165da9ad0f
@ -19,6 +19,7 @@ package cel
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
fuzz "github.com/google/gofuzz"
|
fuzz "github.com/google/gofuzz"
|
||||||
@ -204,3 +205,11 @@ func TestCanSkipRegex(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCELReservedSymbolsNoDoubleUnderscore(t *testing.T) {
|
||||||
|
for symbol := range celReservedSymbols {
|
||||||
|
if strings.Contains(symbol, "__") {
|
||||||
|
t.Errorf("CEL reserved symbol '%s' contains '__', which is not allowed as it would interfere with escaping", symbol)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user