Skip to content

Commit

Permalink
fix #512 revert err check
Browse files Browse the repository at this point in the history
Signed-off-by: Lionello Lunesu <[email protected]>
  • Loading branch information
lionello authored and ndeloof committed Dec 20, 2023
1 parent 2ebf7a5 commit 06ab843
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Option
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
if err := processRawYaml(raw, processor); err != nil {
return nil, err
}
Expand Down
10 changes: 9 additions & 1 deletion loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,14 @@ services:
assert.DeepEqual(t, configWithoutEnvFiles.Services["web"].Environment, expectedEnvironmentMap)
}

func TestDecodeErrors(t *testing.T) {
dict := "name: test\nservices:\n web:\n image: nginx\n\tbuild: ."

configDetails := buildConfigDetails(dict, nil)
_, err := Load(configDetails)
assert.Error(t, err, "yaml: line 4: found a tab character that violates indentation")
}

func TestBuildProperties(t *testing.T) {
dict := `
name: test
Expand Down Expand Up @@ -2768,7 +2776,7 @@ services:
image: example/proxy
build: ./proxy
develop:
watch:
watch:
# rebuild image and recreate service
- path: ./proxy/proxy.conf
action: sync+restart
Expand Down

0 comments on commit 06ab843

Please sign in to comment.