Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions loader/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func _merge(baseService *types.ServiceConfig, overrideService *types.ServiceConf
if err := mergo.Merge(baseService, overrideService, mergo.WithAppendSlice, mergo.WithOverride, mergo.WithTransformers(serviceSpecials)); err != nil {
return nil, err
}
if len(overrideService.Command) > 0 {
if overrideService.Command != nil {
baseService.Command = overrideService.Command
}
if len(overrideService.Entrypoint) > 0 {
if overrideService.Entrypoint != nil {
baseService.Entrypoint = overrideService.Entrypoint
}
return baseService, nil
Expand Down
14 changes: 10 additions & 4 deletions loader/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,9 @@ func TestLoadMultipleConfigs(t *testing.T) {
base := map[string]interface{}{
"services": map[string]interface{}{
"foo": map[string]interface{}{
"image": "foo",
"image": "foo",
"entrypoint": "echo",
"command": "hellow world",
"build": map[string]interface{}{
"context": ".",
"dockerfile": "bar.Dockerfile",
Expand All @@ -894,7 +896,9 @@ func TestLoadMultipleConfigs(t *testing.T) {
override := map[string]interface{}{
"services": map[string]interface{}{
"foo": map[string]interface{}{
"image": "baz",
"image": "baz",
"entrypoint": "ping",
"command": "localhost",
"build": map[string]interface{}{
"dockerfile": "foo.Dockerfile",
"args": []interface{}{
Expand Down Expand Up @@ -942,8 +946,10 @@ func TestLoadMultipleConfigs(t *testing.T) {
Environment: types.MappingWithEquals{},
},
{
Name: "foo",
Image: "baz",
Name: "foo",
Image: "baz",
Entrypoint: types.ShellCommand{"ping"},
Command: types.ShellCommand{"localhost"},
Build: &types.BuildConfig{
Context: ".",
Dockerfile: "foo.Dockerfile",
Expand Down