Skip to content

Commit

Permalink
fix: entrypoint/command from template when possibile
Browse files Browse the repository at this point in the history
Signed-off-by: francesco-racciatti <[email protected]>
  • Loading branch information
francesco-racciatti committed Feb 11, 2024
1 parent 2272de6 commit e2c5166
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtimes/cloudformation/cfnpatcher/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down

0 comments on commit e2c5166

Please sign in to comment.