Skip to content

Commit ef7e84c

Browse files
committed
Adds scenario-based e2e for trust-manager Bundle CR
Signed-off-by: chiragkyal <ckyal@redhat.com>
1 parent bfb8551 commit ef7e84c

5 files changed

Lines changed: 1445 additions & 136 deletions

File tree

test/e2e/suite_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ import (
2323
operatorv1 "github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1"
2424
routev1 "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1"
2525

26+
corev1 "k8s.io/api/core/v1"
27+
k8sruntime "k8s.io/apimachinery/pkg/runtime"
2628
"k8s.io/client-go/kubernetes"
2729
"k8s.io/client-go/rest"
30+
crclient "sigs.k8s.io/controller-runtime/pkg/client"
2831
"sigs.k8s.io/controller-runtime/pkg/client/config"
32+
33+
trustapi "github.com/cert-manager/trust-manager/pkg/apis/trust/v1alpha1"
2934
)
3035

3136
const (
@@ -55,6 +60,7 @@ var (
5560
routeClient *routev1.RouteV1Client
5661
certmanageroperatorclient *certmanoperatorclient.Clientset
5762
certmanagerClient *certmanagerclientset.Clientset
63+
bundleClient crclient.Client
5864

5965
validOperatorStatusConditions = map[string]opv1.ConditionStatus{
6066
"Available": opv1.ConditionTrue,
@@ -153,6 +159,13 @@ var _ = BeforeSuite(func() {
153159
certmanagerClient, err = certmanagerclientset.NewForConfig(cfg)
154160
Expect(err).NotTo(HaveOccurred())
155161

162+
By("creating controller-runtime client for Bundle CRs")
163+
bundleScheme := k8sruntime.NewScheme()
164+
Expect(trustapi.AddToScheme(bundleScheme)).NotTo(HaveOccurred())
165+
Expect(corev1.AddToScheme(bundleScheme)).NotTo(HaveOccurred())
166+
bundleClient, err = crclient.New(cfg, crclient.Options{Scheme: bundleScheme})
167+
Expect(err).NotTo(HaveOccurred())
168+
156169
By("setting defaultNetworkPolicy to true")
157170
err = resetCertManagerNetworkPolicyState(context.TODO(), certmanageroperatorclient)
158171
Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)