Merge pull request #119947 from saschagrunert/keyring-unit

Add unit tests for subdomain match in keyring
This commit is contained in:
Kubernetes Prow Robot 2023-10-25 03:32:05 +02:00 committed by GitHub
commit 925a8dd3d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,22 @@ func TestURLsMatch(t *testing.T) {
targetURL: "kubernetes.io",
matchExpected: false,
},
{
globURL: "*kubernetes.io",
targetURL: "a.kubernetes.io",
matchExpected: false,
},
// match when number of parts match
{
globURL: "*kubernetes.io",
targetURL: "kubernetes.io",
matchExpected: true,
},
{
globURL: "*.*.*.kubernetes.io",
targetURL: "a.b.c.kubernetes.io",
matchExpected: true,
},
// no match when some parts mismatch
{
globURL: "kubernetes.io",