diff --git a/staging/src/k8s.io/apiserver/pkg/cel/escaping_test.go b/staging/src/k8s.io/apiserver/pkg/cel/escaping_test.go index e4b2aa90616..d62fb1f4f2c 100644 --- a/staging/src/k8s.io/apiserver/pkg/cel/escaping_test.go +++ b/staging/src/k8s.io/apiserver/pkg/cel/escaping_test.go @@ -19,6 +19,7 @@ package cel import ( "fmt" "regexp" + "strings" "testing" fuzz "github.com/google/gofuzz" @@ -204,3 +205,12 @@ 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) + } + } +} +