add random suffix to webhooks in CA Injector e2e tests
Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
This commit is contained in:
parent
07677c57bc
commit
de0f39e553
@ -18,19 +18,21 @@ package certificate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
admissionreg "k8s.io/api/admissionregistration/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/rand"
|
||||
"k8s.io/client-go/util/retry"
|
||||
apireg "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
certmanager "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
|
||||
v1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
|
||||
@ -38,7 +40,6 @@ import (
|
||||
"github.com/cert-manager/cert-manager/test/e2e/framework"
|
||||
"github.com/cert-manager/cert-manager/test/e2e/util"
|
||||
"github.com/cert-manager/cert-manager/test/unit/gen"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
type injectableTest struct {
|
||||
@ -324,9 +325,10 @@ var _ = framework.CertManagerDescribe("CA Injector", func() {
|
||||
injectorContext("validating webhook", &injectableTest{
|
||||
makeInjectable: func(namePrefix string) client.Object {
|
||||
someURL := "https://localhost:8675"
|
||||
name := fmt.Sprintf("%s-hook-%s", namePrefix, rand.String(5))
|
||||
return &admissionreg.ValidatingWebhookConfiguration{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: namePrefix + "-hook",
|
||||
Name: name,
|
||||
Annotations: map[string]string{
|
||||
certmanager.WantInjectAnnotation: types.NamespacedName{Name: "serving-certs", Namespace: f.Namespace.Name}.String(),
|
||||
},
|
||||
@ -367,9 +369,10 @@ var _ = framework.CertManagerDescribe("CA Injector", func() {
|
||||
injectorContext("mutating webhook", &injectableTest{
|
||||
makeInjectable: func(namePrefix string) client.Object {
|
||||
someURL := "https://localhost:8675"
|
||||
name := fmt.Sprintf("%s-hook-%s", namePrefix, rand.String(5))
|
||||
return &admissionreg.MutatingWebhookConfiguration{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: namePrefix + "-hook",
|
||||
Name: name,
|
||||
Annotations: map[string]string{
|
||||
certmanager.WantInjectAnnotation: types.NamespacedName{Name: "serving-certs", Namespace: f.Namespace.Name}.String(),
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user