-
Notifications
You must be signed in to change notification settings - Fork 277
/
executables.go
40 lines (32 loc) 路 1.05 KB
/
executables.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
package framework
import (
"context"
"testing"
"github.com/aws/eks-anywhere/pkg/executables"
"github.com/aws/eks-anywhere/pkg/filewriter"
)
func buildKubectl(t *testing.T) *executables.Kubectl {
ctx := context.Background()
return executableBuilder(t, ctx).BuildKubectlExecutable()
}
func buildLocalKubectl() *executables.Kubectl {
return executables.NewLocalExecutableBuilder().BuildKubectlExecutable()
}
func executableBuilder(t *testing.T, ctx context.Context) *executables.ExecutableBuilder {
executableBuilder, err := executables.NewExecutableBuilder(ctx, executables.DefaultEksaImage())
if err != nil {
t.Fatalf("Unable initialize executable builder: %v", err)
}
return executableBuilder
}
func buildGovc(t *testing.T) *executables.Govc {
ctx := context.Background()
tmpWriter, err := filewriter.NewWriter("unique-ip")
if err != nil {
t.Fatalf("Error creating tmp writer")
}
return executableBuilder(t, ctx).BuildGovcExecutable(tmpWriter)
}
func buildDocker(t *testing.T) *executables.Docker {
return executables.BuildDockerExecutable()
}