Skip to content

Commit 165da9a

Browse files
authored
Merge pull request kubernetes#127375 from omerap12/issue_126311
Add test for CEL reserved symbols without double underscore
2 parents 1a9feed + c0b4912 commit 165da9a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

staging/src/k8s.io/apiserver/pkg/cel/escaping_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cel
1919
import (
2020
"fmt"
2121
"regexp"
22+
"strings"
2223
"testing"
2324

2425
fuzz "github.com/google/gofuzz"
@@ -204,3 +205,11 @@ func TestCanSkipRegex(t *testing.T) {
204205
})
205206
}
206207
}
208+
209+
func TestCELReservedSymbolsNoDoubleUnderscore(t *testing.T) {
210+
for symbol := range celReservedSymbols {
211+
if strings.Contains(symbol, "__") {
212+
t.Errorf("CEL reserved symbol '%s' contains '__', which is not allowed as it would interfere with escaping", symbol)
213+
}
214+
}
215+
}

0 commit comments

Comments
 (0)