diff --git a/cmd/arcaflow/main.go b/cmd/arcaflow/main.go index 66f8533b..7ec17213 100644 --- a/cmd/arcaflow/main.go +++ b/cmd/arcaflow/main.go @@ -53,18 +53,6 @@ func main() { Stdout: os.Stderr, }) - defaultConfig := ` -log: - level: info -deployers: - image: - deployer_name: podman - deployment: - imagePullPolicy: IfNotPresent -logged_outputs: - error: - level: info` - configFile := "" input := "" dir := "." @@ -133,12 +121,9 @@ logged_outputs: } var configData any - if len(configFile) == 0 { - if err := yaml.Unmarshal([]byte(defaultConfig), &configData); err != nil { - tempLogger.Errorf("Failed to load default configuration", err) - os.Exit(ExitCodeInvalidData) - } - } else { + // If no config file is passed, we use an empty map to accept the schema defaults + configData = make(map[string]any) + if len(configFile) > 0 { configFilePath, err := fileCtx.AbsPathByKey(RequiredFileKeyConfig) if err != nil { tempLogger.Errorf("Unable to find configuration file %s (%v)", configFile, err) diff --git a/config/load_test.go b/config/load_test.go index daabe002..a815da7e 100644 --- a/config/load_test.go +++ b/config/load_test.go @@ -1,9 +1,10 @@ package config_test import ( - "go.arcalot.io/log/v2" "testing" + "go.arcalot.io/log/v2" + "go.arcalot.io/lang" "go.flow.arcalot.io/engine/config" "gopkg.in/yaml.v3" @@ -19,7 +20,7 @@ var configLoadData = map[string]struct { expectedOutput: &config.Config{ TypeHintPlugins: nil, LocalDeployers: map[string]any{ - "image": map[string]string{"deployer_name": "docker"}, + "image": map[string]string{"deployer_name": "podman"}, }, Log: log.Config{ Level: log.LevelInfo, @@ -35,7 +36,7 @@ log: expectedOutput: &config.Config{ TypeHintPlugins: nil, LocalDeployers: map[string]any{ - "image": map[string]string{"deployer_name": "docker"}, + "image": map[string]string{"deployer_name": "podman"}, }, Log: log.Config{ Level: log.LevelDebug, @@ -70,7 +71,7 @@ plugins: "quay.io/arcalot/example-plugin:latest", }, LocalDeployers: map[string]any{ - "image": map[string]string{"deployer_name": "docker"}, + "image": map[string]string{"deployer_name": "podman"}, }, Log: log.Config{ Level: log.LevelInfo, diff --git a/config/schema.go b/config/schema.go index 9bd216e5..25ff6eea 100644 --- a/config/schema.go +++ b/config/schema.go @@ -63,7 +63,7 @@ func getConfigSchema() *schema.TypedScopeSchema[*Config] { nil, nil, nil, - schema.PointerTo(`{"image": {"deployer_name": "docker"}}`), + schema.PointerTo(`{"image": {"deployer_name": "podman"}}`), nil, ), "logged_outputs": schema.NewPropertySchema( diff --git a/engine_test.go b/engine_test.go index 50f524a0..9f167ac0 100644 --- a/engine_test.go +++ b/engine_test.go @@ -3,9 +3,10 @@ package engine_test import ( "context" "errors" - "go.flow.arcalot.io/engine/loadfile" "testing" + "go.flow.arcalot.io/engine/loadfile" + log "go.arcalot.io/log/v2" "go.flow.arcalot.io/engine" "go.flow.arcalot.io/engine/workflow" @@ -29,7 +30,7 @@ func createTestEngine(t *testing.T) engine.WorkflowEngine { cfg.Log.Level = log.LevelDebug cfg.Log.Destination = log.DestinationTest cfg.LocalDeployers["image"] = map[string]any{ - "deployer_name": "docker", + "deployer_name": "podman", "deployment": map[string]any{ "imagePullPolicy": "IfNotPresent", },