From e2c5166478d745dc09eab43338acd8dce133553f Mon Sep 17 00:00:00 2001 From: francesco-racciatti Date: Mon, 12 Feb 2024 00:06:47 +0100 Subject: [PATCH] fix: entrypoint/command from template when possibile Signed-off-by: francesco-racciatti --- runtimes/cloudformation/cfnpatcher/template.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtimes/cloudformation/cfnpatcher/template.go b/runtimes/cloudformation/cfnpatcher/template.go index 44b7e2f..39c1f4d 100644 --- a/runtimes/cloudformation/cfnpatcher/template.go +++ b/runtimes/cloudformation/cfnpatcher/template.go @@ -44,10 +44,12 @@ func fillContainerInfo(ctx context.Context, container *gabs.Container, parameter if err != nil { l.Warn().Str("image", image).Err(err).Msg("could not retrieve metadata from repository") } else { - if repoInfo.Entrypoint != nil { + if repoInfo.Entrypoint != nil && !container.Exists("EntryPoint") { + l.Info().Str("image", container.S("Image").String()).Msgf("using default entrypoint %s", repoInfo.Entrypoint) container.Set(repoInfo.Entrypoint, "EntryPoint") } - if repoInfo.Command != nil { + if repoInfo.Command != nil && !container.Exists("Command") { + l.Info().Str("image", container.S("Image").String()).Msgf("using default command %s", repoInfo.Command) container.Set(repoInfo.Command, "Command") } }