/
test.go
59 lines (46 loc) · 1.23 KB
/
test.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
package manager
import (
"context"
"github.com/Dynatrace/dynatrace-operator/pkg/api/scheme"
"github.com/Dynatrace/dynatrace-operator/pkg/util/logger"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
)
type TestManager struct {
manager.Manager
}
func (mgr *TestManager) GetClient() client.Client {
return struct{ client.Client }{}
}
func (mgr *TestManager) GetAPIReader() client.Reader {
return nil
}
func (mgr *TestManager) GetControllerOptions() config.Controller {
return config.Controller{}
}
func (mgr *TestManager) GetScheme() *runtime.Scheme {
return scheme.Scheme
}
func (mgr *TestManager) GetCache() cache.Cache {
return nil
}
func (mgr *TestManager) GetLogger() logr.Logger {
return logger.Factory.GetLogger("test-manager")
}
func (mgr *TestManager) GetRESTMapper() meta.RESTMapper {
return nil
}
func (mgr *TestManager) SetFields(any) error {
return nil
}
func (mgr *TestManager) Add(manager.Runnable) error {
return nil
}
func (mgr *TestManager) Start(_ context.Context) error {
return nil
}