mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Ensure backend is ready in listing webhook e2es
This commit is contained in:
parent
3d17fd5c4f
commit
e577feeb91
@ -427,8 +427,11 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(hook.Name, nil)
|
err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(hook.Name, nil)
|
||||||
framework.ExpectNoError(err, "Deleting validating webhook configuration")
|
framework.ExpectNoError(err, "Deleting validating webhook configuration")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// ensure backend is ready before proceeding
|
// ensure backend is ready before proceeding
|
||||||
waitWebhookConfigurationReady(f)
|
err = waitWebhookConfigurationReady(f)
|
||||||
|
framework.ExpectNoError(err, "waiting for webhook configuration to be ready")
|
||||||
|
|
||||||
ginkgo.By("Creating a configMap that does not comply to the validation webhook rules")
|
ginkgo.By("Creating a configMap that does not comply to the validation webhook rules")
|
||||||
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
||||||
cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f)
|
cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f)
|
||||||
@ -520,8 +523,11 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(hook.Name, nil)
|
err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(hook.Name, nil)
|
||||||
framework.ExpectNoError(err, "Deleting mutating webhook configuration")
|
framework.ExpectNoError(err, "Deleting mutating webhook configuration")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// ensure backend is ready before proceeding
|
// ensure backend is ready before proceeding
|
||||||
waitWebhookConfigurationReady(f)
|
err = waitWebhookConfigurationReady(f)
|
||||||
|
framework.ExpectNoError(err, "waiting for webhook configuration to be ready")
|
||||||
|
|
||||||
hook, err = admissionClient.MutatingWebhookConfigurations().Get(f.UniqueName, metav1.GetOptions{})
|
hook, err = admissionClient.MutatingWebhookConfigurations().Get(f.UniqueName, metav1.GetOptions{})
|
||||||
framework.ExpectNoError(err, "Getting mutating webhook configuration")
|
framework.ExpectNoError(err, "Getting mutating webhook configuration")
|
||||||
ginkgo.By("Updating a mutating webhook configuration's rules to not include the create operation")
|
ginkgo.By("Updating a mutating webhook configuration's rules to not include the create operation")
|
||||||
@ -586,6 +592,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
},
|
},
|
||||||
Webhooks: []admissionregistrationv1.ValidatingWebhook{
|
Webhooks: []admissionregistrationv1.ValidatingWebhook{
|
||||||
newDenyConfigMapWebhookFixture(f, context, servicePort),
|
newDenyConfigMapWebhookFixture(f, context, servicePort),
|
||||||
|
newValidatingIsReadyWebhookFixture(f, context, servicePort),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
framework.ExpectNoError(err, "Creating validating webhook configuration")
|
framework.ExpectNoError(err, "Creating validating webhook configuration")
|
||||||
@ -597,6 +604,10 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
framework.ExpectNoError(err, "Listing validating webhook configurations")
|
framework.ExpectNoError(err, "Listing validating webhook configurations")
|
||||||
framework.ExpectEqual(len(list.Items), testListSize)
|
framework.ExpectEqual(len(list.Items), testListSize)
|
||||||
|
|
||||||
|
// ensure backend is ready before proceeding
|
||||||
|
err = waitWebhookConfigurationReady(f)
|
||||||
|
framework.ExpectNoError(err, "waiting for webhook configuration to be ready")
|
||||||
|
|
||||||
ginkgo.By("Creating a configMap that does not comply to the validation webhook rules")
|
ginkgo.By("Creating a configMap that does not comply to the validation webhook rules")
|
||||||
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
||||||
cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f)
|
cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f)
|
||||||
@ -655,6 +666,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
},
|
},
|
||||||
Webhooks: []admissionregistrationv1.MutatingWebhook{
|
Webhooks: []admissionregistrationv1.MutatingWebhook{
|
||||||
newMutateConfigMapWebhookFixture(f, context, 1, servicePort),
|
newMutateConfigMapWebhookFixture(f, context, 1, servicePort),
|
||||||
|
newMutatingIsReadyWebhookFixture(f, context, servicePort),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
framework.ExpectNoError(err, "Creating mutating webhook configuration")
|
framework.ExpectNoError(err, "Creating mutating webhook configuration")
|
||||||
@ -666,6 +678,10 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
|||||||
framework.ExpectNoError(err, "Listing mutating webhook configurations")
|
framework.ExpectNoError(err, "Listing mutating webhook configurations")
|
||||||
framework.ExpectEqual(len(list.Items), testListSize)
|
framework.ExpectEqual(len(list.Items), testListSize)
|
||||||
|
|
||||||
|
// ensure backend is ready before proceeding
|
||||||
|
err = waitWebhookConfigurationReady(f)
|
||||||
|
framework.ExpectNoError(err, "waiting for webhook configuration to be ready")
|
||||||
|
|
||||||
ginkgo.By("Creating a configMap that should be mutated")
|
ginkgo.By("Creating a configMap that should be mutated")
|
||||||
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
||||||
cm := namedToBeMutatedConfigMap(string(uuid.NewUUID()), f)
|
cm := namedToBeMutatedConfigMap(string(uuid.NewUUID()), f)
|
||||||
|
Loading…
Reference in New Issue
Block a user