Skip to content

Commit 06ab843

Browse files
lionellondeloof
authored andcommitted
fix #512 revert err check
Signed-off-by: Lionello Lunesu <[email protected]>
1 parent 2ebf7a5 commit 06ab843

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

loader/loader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Option
342342
if err == io.EOF {
343343
break
344344
}
345+
if err != nil {
346+
return nil, err
347+
}
345348
if err := processRawYaml(raw, processor); err != nil {
346349
return nil, err
347350
}

loader/loader_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,14 @@ services:
944944
assert.DeepEqual(t, configWithoutEnvFiles.Services["web"].Environment, expectedEnvironmentMap)
945945
}
946946

947+
func TestDecodeErrors(t *testing.T) {
948+
dict := "name: test\nservices:\n web:\n image: nginx\n\tbuild: ."
949+
950+
configDetails := buildConfigDetails(dict, nil)
951+
_, err := Load(configDetails)
952+
assert.Error(t, err, "yaml: line 4: found a tab character that violates indentation")
953+
}
954+
947955
func TestBuildProperties(t *testing.T) {
948956
dict := `
949957
name: test
@@ -2768,7 +2776,7 @@ services:
27682776
image: example/proxy
27692777
build: ./proxy
27702778
develop:
2771-
watch:
2779+
watch:
27722780
# rebuild image and recreate service
27732781
- path: ./proxy/proxy.conf
27742782
action: sync+restart

0 commit comments

Comments
 (0)