diff options
-rw-r--r-- | config/common.go | 2 | ||||
-rw-r--r-- | config/common_test.go | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/config/common.go b/config/common.go index 32311b8..90c9c5b 100644 --- a/config/common.go +++ b/config/common.go @@ -32,7 +32,7 @@ func (cc *CommonConfig) Merge(cc2 CommonConfig) { cc.Lives.Merge(cc2.Lives) cc.Runs.Merge(cc2.Runs) - if len(cc.EntryPoint) < 1 { + if cc2.EntryPoint != nil { cc.EntryPoint = cc2.EntryPoint } } diff --git a/config/common_test.go b/config/common_test.go index ba9333e..d22bcff 100644 --- a/config/common_test.go +++ b/config/common_test.go @@ -27,6 +27,15 @@ func TestCommonConfigYAML(t *testing.T) { assert.Equal(t, []string{"/bin/foo"}, variant.EntryPoint) } +// Ensure that entrypoints inherit correctly +// +func TestEntryPointMerge(t *testing.T) { + foo := config.CommonConfig{EntryPoint: []string{"/bin/foo"}} + bar := config.CommonConfig{EntryPoint: []string{"/bin/bar"}} + foo.Merge(bar) + assert.Equal(t, []string{"/bin/bar"}, foo.EntryPoint) +} + func TestCommonConfigValidation(t *testing.T) { t.Run("base", func(t *testing.T) { t.Run("ok", func(t *testing.T) { |