Skip to content

Commit

Permalink
chore: run standard DataPlane tests for BlueGreen (Kong/gateway-opera…
Browse files Browse the repository at this point in the history
…tor-archive#1619)

* chore: run standard DataPlane tests for BlueGreen

When running the BlueGreen integration tests, include standard DataPlane
tests also. These should still function the same way with the BlueGreen
controller, but may be broken by improper delegation.

* fix: create delegate eventRecorder
  • Loading branch information
rainest authored Mar 14, 2024
1 parent dfb3b98 commit cd9e810
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ test.integration:
test.integration_bluegreen:
@$(MAKE) _test.integration \
GATEWAY_OPERATOR_BLUEGREEN_CONTROLLER="true" \
GOTESTFLAGS="-run=BlueGreen $(GOTESTFLAGS)" \
GOTESTFLAGS="-run='BlueGreen|TestDataPlane' $(GOTESTFLAGS)" \
COVERPROFILE="coverage.integration-bluegreen.out" \

.PHONY: test.integration_provision_dataplane_fail
Expand Down
5 changes: 5 additions & 0 deletions controllers/dataplane/bluegreen_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ type BlueGreenReconciler struct {

// SetupWithManager sets up the controller with the Manager.
func (r *BlueGreenReconciler) SetupWithManager(mgr ctrl.Manager) error {
delegate, ok := r.DataPlaneController.(*Reconciler)
if !ok {
return fmt.Errorf("incorrect delegate controller type: %T", r.DataPlaneController)
}
delegate.eventRecorder = mgr.GetEventRecorderFor("dataplane")
return DataPlaneWatchBuilder(mgr).
Complete(r)
}
Expand Down

0 comments on commit cd9e810

Please sign in to comment.