mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
Merge pull request #119947 from saschagrunert/keyring-unit
Add unit tests for subdomain match in keyring
This commit is contained in:
commit
925a8dd3d3
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user