mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
Add unit tests for subdomain match in keyring
This ensures that the amount of subdomains should always match the glob+dot (`*.`) pattern. Refers to https://github.com/kubernetes/kubernetes/issues/119941 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
parent
6e0cb243d5
commit
3edae95e5a
@ -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