From d0aa30205ddadc5c4df97b68e016387cf16d066b Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Fri, 26 Oct 2018 18:31:49 +0200 Subject: [PATCH] Fix end-to-end test logic to get image name The command executed in ValidateController function uses the image name of the running container. This is a problem in multiarch images, since the image name is the name of the image specific to the architecture, but the image passed as parameter is the multiarch one (as the test are architecture agnostic), making the test to fail. This patch fixes it by making the logic use a command that get the multiarch name given in the container spec. Signed-off-by: Miguel Herranz --- test/e2e/framework/rc_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/framework/rc_util.go b/test/e2e/framework/rc_util.go index edd88dd0ba4..d7a88937f26 100644 --- a/test/e2e/framework/rc_util.go +++ b/test/e2e/framework/rc_util.go @@ -247,7 +247,7 @@ func ValidateController(c clientset.Interface, containerImage string, replicas i // You can read about the syntax here: http://golang.org/pkg/text/template/. getContainerStateTemplate := fmt.Sprintf(`--template={{if (exists . "status" "containerStatuses")}}{{range .status.containerStatuses}}{{if (and (eq .name "%s") (exists . "state" "running"))}}true{{end}}{{end}}{{end}}`, containername) - getImageTemplate := fmt.Sprintf(`--template={{if (exists . "status" "containerStatuses")}}{{range .status.containerStatuses}}{{if eq .name "%s"}}{{.image}}{{end}}{{end}}{{end}}`, containername) + getImageTemplate := fmt.Sprintf(`--template={{if (exists . "spec" "containers")}}{{range .spec.containers}}{{if eq .name "%s"}}{{.image}}{{end}}{{end}}{{end}}`, containername) By(fmt.Sprintf("waiting for all containers in %s pods to come up.", testname)) //testname should be selector waitLoop: