From 0448673af283588654f0197fefc33025cf371b6e Mon Sep 17 00:00:00 2001 From: Andrey Klimentyev Date: Mon, 29 Mar 2021 13:36:24 +0300 Subject: [PATCH] Do not append []string{""} to command to preserve Docker compatibility Signed-off-by: Andrey Klimentyev (cherry picked from commit 5f3ce9512b74718ac9519196ba70dfb1ee075fbe) Signed-off-by: Andrey Klimentyev --- pkg/cri/opts/spec.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cri/opts/spec.go b/pkg/cri/opts/spec.go index df10fbf501c3..00419cb9a56b 100644 --- a/pkg/cri/opts/spec.go +++ b/pkg/cri/opts/spec.go @@ -63,7 +63,9 @@ func WithProcessArgs(config *runtime.ContainerConfig, image *imagespec.ImageConf args = append([]string{}, image.Cmd...) } if command == nil { - command = append([]string{}, image.Entrypoint...) + if !(len(image.Entrypoint) == 1 && image.Entrypoint[0] == "") { + command = append([]string{}, image.Entrypoint...) + } } } if len(command) == 0 && len(args) == 0 {