/
operator.go
42 lines (39 loc) · 1.28 KB
/
operator.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
package operators
import (
appsv1 "k8s.io/api/apps/v1"
"k8s.io/client-go/rest"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)
type OperatorSetupBuilder interface {
NewBuilder(restConfig *rest.Config, rawConfig *clientcmdapi.Config) OperatorSetupBuilder
WithNamespace(namespace string) OperatorSetupBuilder
WithImage(image string) OperatorSetupBuilder
WithCommand(command string) OperatorSetupBuilder
WithYamlURLs(yamls []string) OperatorSetupBuilder
AddYamlURL(yaml string) OperatorSetupBuilder
WithOperatorName(name string) OperatorSetupBuilder
KeepCdr(keepCdrs bool) OperatorSetupBuilder
SetAdminUnavailable() OperatorSetupBuilder
SetOperatorName(operatorName string) OperatorSetupBuilder
WithApiVersion(apiVersion string) OperatorSetupBuilder
WithYamls(yamls [][]byte) OperatorSetupBuilder
WithGlobalNamespace() OperatorSetupBuilder
Build() (OperatorSetup, error)
OperatorType() OperatorType
}
type OperatorSetup interface {
Interface() interface{}
Namespace() string
Image() string
Name() string
CRDNames() []string
GroupName() string
APIVersion() string
Setup() error
UpdateDeployment(deployment *appsv1.Deployment) error
DeleteDeployment() error
CreateDeployment() error
GetDeployment() (*appsv1.Deployment, error)
TeardownEach() error
TeardownSuite() error
}