Commit d0aa3020 authored by Miguel Herranz's avatar Miguel Herranz

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: 's avatarMiguel Herranz <miguel@midokura.com>
parent c0d248ad
...@@ -247,7 +247,7 @@ func ValidateController(c clientset.Interface, containerImage string, replicas i ...@@ -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/. // 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) 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 By(fmt.Sprintf("waiting for all containers in %s pods to come up.", testname)) //testname should be selector
waitLoop: waitLoop:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment