-
Notifications
You must be signed in to change notification settings - Fork 284
/
docker.go
54 lines (41 loc) · 1.01 KB
/
docker.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
package framework
import (
"testing"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
type Docker struct {
t *testing.T
}
func NewDocker(t *testing.T) *Docker {
return &Docker{
t: t,
}
}
func (d *Docker) Name() string {
return "docker"
}
func (d *Docker) Setup() {}
func (d *Docker) CustomizeProviderConfig(file string) []byte {
providerConfig, err := v1alpha1.GetDockerDatacenterConfig(file)
if err != nil {
d.t.Fatalf("Unable to get provider config from file: %v", err)
}
providerOutput, err := yaml.Marshal(providerConfig)
if err != nil {
d.t.Fatalf("error marshalling cluster config: %v", err)
}
return providerOutput
}
func (d *Docker) CleanupVMs(_ string) error {
return nil
}
func (d *Docker) WithProviderUpgradeGit() ClusterE2ETestOpt {
return func(e *ClusterE2ETest) {
e.ProviderConfigB = d.CustomizeProviderConfig(e.clusterConfigGitPath())
}
}
func (d *Docker) ClusterConfigFillers() []api.ClusterFiller {
return nil
}