Flower service and updated kubectl outputs in examples/clery-rabbitmq

This commit is contained in:
Marcin Wielgus
2015-07-08 11:01:55 +02:00
parent 03c27916a0
commit 2bf1e50b8a
4 changed files with 75 additions and 11 deletions

View File

@@ -127,6 +127,7 @@ var _ = Describe("Examples e2e", func() {
rabbitmqControllerYaml := mkpath("rabbitmq-controller.yaml")
celeryControllerYaml := mkpath("celery-controller.yaml")
flowerControllerYaml := mkpath("flower-controller.yaml")
flowerServiceYaml := mkpath("flower-service.yaml")
nsFlag := fmt.Sprintf("--namespace=%v", ns)
By("starting rabbitmq")
@@ -144,14 +145,32 @@ var _ = Describe("Examples e2e", func() {
})
By("starting flower")
runKubectl("create", "-f", flowerServiceYaml, nsFlag)
runKubectl("create", "-f", flowerControllerYaml, nsFlag)
forEachPod(c, ns, "component", "flower", func(pod api.Pod) {
//TODO: Do a http request after a flower service is added to the example.
// Do nothing. just wait for it to be up and running.
})
content, err := makeHttpRequestToService(c, ns, "flower-service", "/")
Expect(err).NotTo(HaveOccurred())
if !strings.Contains(content, "<title>Celery Flower</title>") {
Failf("Flower HTTP request failed")
}
})
})
})
func makeHttpRequestToService(c *client.Client, ns, service, path string) (string, error) {
result, err := c.Get().
Prefix("proxy").
Namespace(ns).
Resource("services").
Name(service).
Suffix(path).
Do().
Raw()
return string(result), err
}
func forEachPod(c *client.Client, ns, selectorKey, selectorValue string, fn func(api.Pod)) {
var pods *api.PodList
var err error