Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Sep 13, 2023
1 parent e5fefd2 commit b5ae572
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/serviceaccount_controller_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ func unitTestsReconcileNormal() {
)

JustBeforeEach(func() {
controllerCtx = helpers.NewUnitTestContextForController(namespace, vsphereCluster, false, initObjects, nil)
// Note: The service account provider requires a reference to the vSphereCluster hence the need to create
// a fake vSphereCluster in the test and pass it to during context setup.
reconciler = ServiceAccountReconciler{}
controllerCtx = helpers.NewUnitTestContextForController(namespace, vsphereCluster, false, initObjects, nil)
reconciler = ServiceAccountReconciler{
// Note: This also sets the client.Client.
ControllerContext: controllerCtx.ControllerContext,
}
_, err := reconciler.ReconcileNormal(ctx, controllerCtx.GuestClusterContext)
Expect(err).NotTo(HaveOccurred())

Expand Down
4 changes: 4 additions & 0 deletions controllers/svcdiscovery_controller_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func serviceDiscoveryUnitTestsReconcileNormal() {
JustBeforeEach(func() {
vsphereCluster = fake.NewVSphereCluster(namespace)
controllerCtx = helpers.NewUnitTestContextForController(namespace, &vsphereCluster, false, initObjects, nil)
reconciler = serviceDiscoveryReconciler{
// Note: This also sets the client.Client.
ControllerContext: controllerCtx.ControllerContext,
}
_, err := reconciler.ReconcileNormal(ctx, controllerCtx.GuestClusterContext)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit b5ae572

Please sign in to comment.