mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +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",
|
targetURL: "kubernetes.io",
|
||||||
matchExpected: false,
|
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
|
// no match when some parts mismatch
|
||||||
{
|
{
|
||||||
globURL: "kubernetes.io",
|
globURL: "kubernetes.io",
|
||||||
|
Loading…
Reference in New Issue
Block a user