-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.go
62 lines (54 loc) · 1.47 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package config
import (
"github.com/kube-cicd/pipelines-feedback-core/pkgs/apis/pipelinesfeedback.keskad.pl/v1alpha1"
"github.com/kube-cicd/pipelines-feedback-core/pkgs/contract"
"github.com/kube-cicd/pipelines-feedback-core/pkgs/logging"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
)
type FakeCollector struct {
}
func (f *FakeCollector) SetLogger(logger *logging.InternalLogger) {
}
func (f *FakeCollector) InjectDependencies(recorder record.EventRecorder, kubeconfig *rest.Config) error {
return nil
}
func (f *FakeCollector) CanHandle(adapterName string) bool {
return true
}
func (f *FakeCollector) GetImplementationName() string {
return "fake"
}
func (f *FakeCollector) CollectInitially() ([]*v1alpha1.PFConfig, error) {
return []*v1alpha1.PFConfig{
{
TypeMeta: v1.TypeMeta{},
ObjectMeta: v1.ObjectMeta{
Name: "bread",
Namespace: "books",
},
Spec: v1alpha1.Spec{},
Data: v1alpha1.Data{
"rating": "What a tasty book!",
},
Status: v1alpha1.PFCStatus{},
},
}, nil
}
func (f *FakeCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error) {
return []*v1alpha1.PFConfig{
{
TypeMeta: v1.TypeMeta{},
ObjectMeta: v1.ObjectMeta{
Name: "mutual-aid-a-factor-of-revolution",
Namespace: "books",
},
Spec: v1alpha1.Spec{},
Data: v1alpha1.Data{
"rating": "What a fantastic book!",
},
Status: v1alpha1.PFCStatus{},
},
}, nil
}