refactor: Use koanf.Koanf in e2e tests to pass agent configuration instead of CLI arguments

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2023-08-10 07:55:45 +02:00
parent a4a9d14765
commit ff10036140
18 changed files with 244 additions and 161 deletions

View File

@@ -8,6 +8,7 @@ import (
"strings"
"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/rawbytes"
"github.com/knadh/koanf/v2"
)
@@ -44,7 +45,7 @@ func (s *Source) Load() error {
func load(p koanf.Provider) (*koanf.Koanf, []string, error) {
var q koanf.Parser
switch p.(type) {
case *RemoteFileProvider, *LocalFileProvider:
case *RemoteFileProvider, *LocalFileProvider, *rawbytes.RawBytes:
q = yaml.Parser()
default:
q = nil