-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.go
36 lines (30 loc) · 1.08 KB
/
fake.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
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
context "context"
factoryfiltered "github.com/zeiss/typhoon/pkg/client/generated/injection/informers/factory/filtered"
filtered "github.com/zeiss/typhoon/pkg/client/generated/injection/informers/flow/v1alpha1/xslttransformation/filtered"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
var Get = filtered.Get
func init() {
injection.Fake.RegisterFilteredInformers(withInformer)
}
func withInformer(ctx context.Context) (context.Context, []controller.Informer) {
untyped := ctx.Value(factoryfiltered.LabelKey{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch labelkey from context.")
}
labelSelectors := untyped.([]string)
infs := []controller.Informer{}
for _, selector := range labelSelectors {
f := factoryfiltered.Get(ctx, selector)
inf := f.Flow().V1alpha1().XSLTTransformations()
ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf)
infs = append(infs, inf.Informer())
}
return ctx, infs
}