Skip to content

Commit

Permalink
Merge pull request #250 from ulucinar/cp-pr-249
Browse files Browse the repository at this point in the history
Set a default EventHandler if the provider's main module does not supply one
  • Loading branch information
ulucinar committed Aug 4, 2023
2 parents 06bdecc + 27c0c94 commit 8d86393
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/pipeline/templates/setup.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/upbound/upjet/pkg/controller"
"github.com/upbound/upjet/pkg/controller/handler"

{{ .Imports }}
)

// Setup{{ .Group }} creates all controllers with the supplied logger and adds them to
// the supplied manager.
func Setup{{ .Group }}(mgr ctrl.Manager, o controller.Options) error {
// set the default event handler if the provider's main module did not
// set one.
if o.EventHandler == nil {
o.EventHandler = handler.NewEventHandler()
}
for _, setup := range []func(ctrl.Manager, controller.Options) error{
{{- range $alias := .Aliases }}
{{ $alias }}Setup,
Expand Down

0 comments on commit 8d86393

Please sign in to comment.