-
Notifications
You must be signed in to change notification settings - Fork 0
/
env_toml_config.go
53 lines (47 loc) · 1.62 KB
/
env_toml_config.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
package main
import (
ctf_config "github.com/goplugin/plugin-testing-framework/lib/config"
"github.com/goplugin/plugin-testing-framework/lib/k8s/environment"
"github.com/goplugin/plugin-testing-framework/lib/k8s/pkg/helm/plugin"
"github.com/goplugin/plugin-testing-framework/lib/k8s/pkg/helm/ethereum"
"github.com/goplugin/plugin-testing-framework/lib/k8s/pkg/helm/mockserver"
mockservercfg "github.com/goplugin/plugin-testing-framework/lib/k8s/pkg/helm/mockserver-cfg"
"github.com/goplugin/plugin-testing-framework/lib/utils/ptr"
)
func main() {
// in actual implementation here you should read the config from TOML file instead of creating structs manually
pluginConfig := ctf_config.PluginImageConfig{
Image: ptr.Ptr("public.ecr.aws/plugin/plugin"),
Version: ptr.Ptr("v2.8.0"),
PostgresVersion: ptr.Ptr("15.6"),
}
pyroscope := ctf_config.PyroscopeConfig{
Enabled: ptr.Ptr(false),
}
config := struct {
Plugin ctf_config.PluginImageConfig
Pyroscope ctf_config.PyroscopeConfig
}{
Plugin: pluginConfig,
Pyroscope: pyroscope,
}
var overrideFn = func(_ interface{}, target interface{}) {
ctf_config.MustConfigOverridePluginVersion(&pluginConfig, target)
ctf_config.MightConfigOverridePyroscopeKey(&pyroscope, target)
}
err := environment.New(&environment.Config{
NamespacePrefix: "ztest",
KeepConnection: true,
RemoveOnInterrupt: true,
}).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(nil)).
AddHelm(plugin.NewWithOverride(0, map[string]interface{}{
"replicas": 1,
}, &config, overrideFn)).
Run()
if err != nil {
panic(err)
}
}