Merge pull request #78765 from liggitt/fix-duplicate-webhook-test

Fix conflicting duplicate webhook test
This commit is contained in:
Kubernetes Prow Robot 2019-06-06 12:57:28 -07:00 committed by GitHub
commit 59abf0fe3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,6 @@ const (
attachingPodWebhookConfigName = "e2e-test-webhook-config-attaching-pod" attachingPodWebhookConfigName = "e2e-test-webhook-config-attaching-pod"
mutatingWebhookConfigName = "e2e-test-mutating-webhook-config" mutatingWebhookConfigName = "e2e-test-mutating-webhook-config"
podMutatingWebhookConfigName = "e2e-test-mutating-webhook-pod" podMutatingWebhookConfigName = "e2e-test-mutating-webhook-pod"
crMutatingWebhookConfigName = "e2e-test-mutating-webhook-config-cr"
webhookFailClosedConfigName = "e2e-test-webhook-fail-closed" webhookFailClosedConfigName = "e2e-test-webhook-fail-closed"
validatingWebhookForWebhooksConfigName = "e2e-test-validating-webhook-for-webhooks-config" validatingWebhookForWebhooksConfigName = "e2e-test-validating-webhook-for-webhooks-config"
mutatingWebhookForWebhooksConfigName = "e2e-test-mutating-webhook-for-webhooks-config" mutatingWebhookForWebhooksConfigName = "e2e-test-mutating-webhook-for-webhooks-config"
@ -233,13 +232,6 @@ var _ = SIGDescribe("AdmissionWebhook", func() {
testMutatingCustomResourceWebhook(f, testcrd.Crd, testcrd.DynamicClients["v1"], prune) testMutatingCustomResourceWebhook(f, testcrd.Crd, testcrd.DynamicClients["v1"], prune)
}) })
ginkgo.It("Should deny crd creation", func() {
crdWebhookCleanup := registerValidatingWebhookForCRD(f, context)
defer crdWebhookCleanup()
testCRDDenyWebhook(f)
})
ginkgo.It("Should honor timeout", func() { ginkgo.It("Should honor timeout", func() {
policyFail := v1beta1.Fail policyFail := v1beta1.Fail
policyIgnore := v1beta1.Ignore policyIgnore := v1beta1.Ignore
@ -1340,10 +1332,10 @@ func registerWebhookForCustomResource(f *framework.Framework, context *certConte
func registerMutatingWebhookForCustomResource(f *framework.Framework, context *certContext, testcrd *crd.TestCrd) func() { func registerMutatingWebhookForCustomResource(f *framework.Framework, context *certContext, testcrd *crd.TestCrd) func() {
client := f.ClientSet client := f.ClientSet
ginkgo.By("Registering the mutating webhook for a custom resource via the AdmissionRegistration API") ginkgo.By(fmt.Sprintf("Registering the mutating webhook for custom resource %s via the AdmissionRegistration API", testcrd.Crd.Name))
namespace := f.Namespace.Name namespace := f.Namespace.Name
configName := crMutatingWebhookConfigName configName := f.UniqueName
_, err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Create(&v1beta1.MutatingWebhookConfiguration{ _, err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Create(&v1beta1.MutatingWebhookConfiguration{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: configName, Name: configName,