mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Make CRD admission webhook e2e work in parallel test environments
This commit is contained in:
parent
d150f15d91
commit
97ad87df02
@ -2061,8 +2061,8 @@ func registerValidatingWebhookForCRD(f *framework.Framework, configName string,
|
|||||||
},
|
},
|
||||||
SideEffects: &sideEffectsNone,
|
SideEffects: &sideEffectsNone,
|
||||||
AdmissionReviewVersions: []string{"v1", "v1beta1"},
|
AdmissionReviewVersions: []string{"v1", "v1beta1"},
|
||||||
// Scope the webhook to just this namespace
|
// Scope the webhook to just this test
|
||||||
NamespaceSelector: &metav1.LabelSelector{
|
ObjectSelector: &metav1.LabelSelector{
|
||||||
MatchLabels: map[string]string{f.UniqueName: "true"},
|
MatchLabels: map[string]string{f.UniqueName: "true"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -2113,6 +2113,9 @@ func testCRDDenyWebhook(f *framework.Framework) {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: name + "s." + group,
|
Name: name + "s." + group,
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
|
// this label ensures our object is routed to this test's webhook
|
||||||
|
f.UniqueName: "true",
|
||||||
|
// this is the label the webhook disallows
|
||||||
"webhook-e2e-test": "webhook-disallow",
|
"webhook-e2e-test": "webhook-disallow",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user