mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-13 01:17:39 +00:00
Respect image entrypoint in play kube
Before we ignored an entrypoint specified in an image, which lead to crashes when a user assumed the entrypoint would be used Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
parent
bda28c61db
commit
65372ee3ab
1 changed files with 13 additions and 1 deletions
|
|
@ -270,7 +270,19 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container
|
|||
}
|
||||
}
|
||||
|
||||
containerConfig.Command = containerYAML.Command
|
||||
containerConfig.Command = []string{}
|
||||
if imageData != nil && imageData.Config != nil {
|
||||
containerConfig.Command = append(containerConfig.Command, imageData.Config.Entrypoint...)
|
||||
}
|
||||
if len(containerConfig.Command) != 0 {
|
||||
containerConfig.Command = append(containerConfig.Command, containerYAML.Command...)
|
||||
} else if imageData != nil && imageData.Config != nil {
|
||||
containerConfig.Command = append(containerConfig.Command, imageData.Config.Cmd...)
|
||||
}
|
||||
if imageData != nil && len(containerConfig.Command) == 0 {
|
||||
return nil, errors.Errorf("No command specified in container YAML or as CMD or ENTRYPOINT in this image for %s", containerConfig.Name)
|
||||
}
|
||||
|
||||
containerConfig.StopSignal = 15
|
||||
|
||||
// If the user does not pass in ID mappings, just set to basics
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue