From ceeac16dc48d2553f5dc45be2cb7607b17f3eb78 Mon Sep 17 00:00:00 2001 From: feihujiang Date: Mon, 9 Nov 2015 15:23:48 +0800 Subject: [PATCH] Remove use of legacy pods proxy path --- test/e2e/dns.go | 4 ++-- test/e2e/kubectl.go | 8 ++++---- test/e2e/pre_stop.go | 3 ++- test/e2e/util.go | 2 +- test/e2e/volumes.go | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/e2e/dns.go b/test/e2e/dns.go index 0f72849721c..d4bb7181e8e 100644 --- a/test/e2e/dns.go +++ b/test/e2e/dns.go @@ -133,9 +133,9 @@ func assertFilesExist(fileNames []string, fileDir string, pod *api.Pod, client * failed = []string{} for _, fileName := range fileNames { if _, err := client.Get(). - Prefix("proxy"). - Resource("pods"). Namespace(pod.Namespace). + Resource("pods"). + SubResource("proxy"). Name(pod.Name). Suffix(fileDir, fileName). Do().Raw(); err != nil { diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index 4a4ab2f8f21..e5fd33e25ea 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -260,10 +260,10 @@ var _ = Describe("Kubectl client", func() { Failf("unable to create streaming upload. Error: %s", err) } resp, err := c.Post(). - Prefix("proxy"). Namespace(ns). Name("netexec"). Resource("pods"). + SubResource("proxy"). Suffix("upload"). SetHeader("Content-Type", postConfigBodyWriter.FormDataContentType()). Body(pipeConfigReader). @@ -287,10 +287,10 @@ var _ = Describe("Kubectl client", func() { var uploadOutput NetexecOutput // Upload the kubectl binary resp, err = c.Post(). - Prefix("proxy"). Namespace(ns). Name("netexec"). Resource("pods"). + SubResource("proxy"). Suffix("upload"). SetHeader("Content-Type", postBodyWriter.FormDataContentType()). Body(pipeReader). @@ -325,10 +325,10 @@ var _ = Describe("Kubectl client", func() { shellCommand := fmt.Sprintf("%s=%s .%s --kubeconfig=%s --server=%s --namespace=%s exec nginx echo running in container", proxyVar, proxyAddr, uploadBinaryName, kubecConfigRemotePath, apiServer, ns) // Execute kubectl on remote exec server. netexecShellOutput, err := c.Post(). - Prefix("proxy"). Namespace(ns). Name("netexec"). Resource("pods"). + SubResource("proxy"). Suffix("shell"). Param("shellCommand", shellCommand). Do().Raw() @@ -1121,9 +1121,9 @@ func getUDData(jpgExpected string, ns string) func(*client.Client, string) error return func(c *client.Client, podID string) error { Logf("validating pod %s", podID) body, err := c.Get(). - Prefix("proxy"). Namespace(ns). Resource("pods"). + SubResource("proxy"). Name(podID). Suffix("data.json"). Do(). diff --git a/test/e2e/pre_stop.go b/test/e2e/pre_stop.go index 89b79a5d51e..4cd93838ab7 100644 --- a/test/e2e/pre_stop.go +++ b/test/e2e/pre_stop.go @@ -118,8 +118,9 @@ func testPreStop(c *client.Client, ns string) { // Validate that the server received the web poke. err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) { if body, err := c.Get(). - Namespace(ns).Prefix("proxy"). + Namespace(ns). Resource("pods"). + SubResource("proxy"). Name(podDescr.Name). Suffix("read"). DoRaw(); err != nil { diff --git a/test/e2e/util.go b/test/e2e/util.go index 785539a508b..794ee62c212 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -796,9 +796,9 @@ func (r podResponseChecker) checkAllResponses() (done bool, err error) { return false, fmt.Errorf("pod with UID %s is no longer a member of the replica set. Must have been restarted for some reason. Current replica set: %v", pod.UID, currentPods) } body, err := r.c.Get(). - Prefix("proxy"). Namespace(r.ns). Resource("pods"). + SubResource("proxy"). Name(string(pod.Name)). Do(). Raw() diff --git a/test/e2e/volumes.go b/test/e2e/volumes.go index a28312a6b62..46fef343879 100644 --- a/test/e2e/volumes.go +++ b/test/e2e/volumes.go @@ -227,8 +227,8 @@ func testVolumeClient(client *client.Client, config VolumeTestConfig, volume api By("reading a web page from the client") body, err := client.Get(). Namespace(config.namespace). - Prefix("proxy"). Resource("pods"). + SubResource("proxy"). Name(clientPod.Name). DoRaw() expectNoError(err, "Cannot read web page: %v", err)