-
Notifications
You must be signed in to change notification settings - Fork 25
/
controller.go
43 lines (30 loc) · 1.16 KB
/
controller.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by injection-gen. DO NOT EDIT.
package vspheresource
import (
context "context"
vspheresource "github.com/vmware-tanzu/sources-for-knative/pkg/client/injection/informers/sources/v1alpha1/vspheresource"
v1alpha1vspheresource "github.com/vmware-tanzu/sources-for-knative/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource"
configmap "knative.dev/pkg/configmap"
controller "knative.dev/pkg/controller"
logging "knative.dev/pkg/logging"
)
// TODO: PLEASE COPY AND MODIFY THIS FILE AS A STARTING POINT
// NewController creates a Reconciler for VSphereSource and returns the result of NewImpl.
func NewController(
ctx context.Context,
cmw configmap.Watcher,
) *controller.Impl {
logger := logging.FromContext(ctx)
vspheresourceInformer := vspheresource.Get(ctx)
// TODO: setup additional informers here.
r := &Reconciler{}
impl := v1alpha1vspheresource.NewImpl(ctx, r)
logger.Info("Setting up event handlers.")
vspheresourceInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
// TODO: add additional informer event handlers here.
return impl
}