/
tester.go
52 lines (43 loc) · 1.62 KB
/
tester.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
/**************************/
/* TO BE DEPRECATED
/**************************/
// Package ekstester defines interface EKS cluster tester and deployer.
package ekstester
import (
osexec "os/exec"
"time"
"github.com/aws/aws-k8s-tester/eksconfig"
"k8s.io/client-go/kubernetes"
)
// Tester defines aws-k8s-tester eks specific operations.
type Tester interface {
Deployer
// UploadToBucketForTests uploads a local file to aws-k8s-tester S3 bucket.
UploadToBucketForTests(localPath, remotePath string) error
}
// Deployer defines EKS deployer.
// Satisfies "k8s.io/test-infra/kubetest/main.go" 'deployer' interfaces.
// Reference https://github.com/kubernetes/test-infra/blob/master/kubetest/main.go.
type Deployer interface {
Up() error
IsUp() error
TestSetup() error
Down() error
GetClusterCreated(gcpProject string) (time.Time, error)
DumpClusterLogs(artifactDir, _ string) error
// GetWorkerNodeLogs downloads logs from worker node machines.
GetWorkerNodeLogs() error
// Stop stops ongoing operations.
// This is useful for local development.
// For example, one may run "Up" but have to cancel onging "Up"
// operation. Then, it can just send syscall.SIGINT to trigger "Stop".
Stop()
// LoadConfig reloads configuration from disk to read the latest
// cluster configuration and its states.
// It's either reloaded from disk or returned from embedded EKS deployer.
LoadConfig() (eksconfig.Config, error)
// KubectlCommand returns "kubectl" command object for API reachability tests.
KubectlCommand() (*osexec.Cmd, error)
// KubernetesClientSet returns Kubernetes Go client.
KubernetesClientSet() *kubernetes.Clientset
}