Merge pull request #17002 from feihujiang/removeUseOfLegacyPodsProxyPath

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2015-11-09 17:13:40 -08:00
commit a436da79fb
5 changed files with 10 additions and 9 deletions

View File

@ -133,9 +133,9 @@ func assertFilesExist(fileNames []string, fileDir string, pod *api.Pod, client *
failed = []string{} failed = []string{}
for _, fileName := range fileNames { for _, fileName := range fileNames {
if _, err := client.Get(). if _, err := client.Get().
Prefix("proxy").
Resource("pods").
Namespace(pod.Namespace). Namespace(pod.Namespace).
Resource("pods").
SubResource("proxy").
Name(pod.Name). Name(pod.Name).
Suffix(fileDir, fileName). Suffix(fileDir, fileName).
Do().Raw(); err != nil { Do().Raw(); err != nil {

View File

@ -260,10 +260,10 @@ var _ = Describe("Kubectl client", func() {
Failf("unable to create streaming upload. Error: %s", err) Failf("unable to create streaming upload. Error: %s", err)
} }
resp, err := c.Post(). resp, err := c.Post().
Prefix("proxy").
Namespace(ns). Namespace(ns).
Name("netexec"). Name("netexec").
Resource("pods"). Resource("pods").
SubResource("proxy").
Suffix("upload"). Suffix("upload").
SetHeader("Content-Type", postConfigBodyWriter.FormDataContentType()). SetHeader("Content-Type", postConfigBodyWriter.FormDataContentType()).
Body(pipeConfigReader). Body(pipeConfigReader).
@ -287,10 +287,10 @@ var _ = Describe("Kubectl client", func() {
var uploadOutput NetexecOutput var uploadOutput NetexecOutput
// Upload the kubectl binary // Upload the kubectl binary
resp, err = c.Post(). resp, err = c.Post().
Prefix("proxy").
Namespace(ns). Namespace(ns).
Name("netexec"). Name("netexec").
Resource("pods"). Resource("pods").
SubResource("proxy").
Suffix("upload"). Suffix("upload").
SetHeader("Content-Type", postBodyWriter.FormDataContentType()). SetHeader("Content-Type", postBodyWriter.FormDataContentType()).
Body(pipeReader). 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) 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. // Execute kubectl on remote exec server.
netexecShellOutput, err := c.Post(). netexecShellOutput, err := c.Post().
Prefix("proxy").
Namespace(ns). Namespace(ns).
Name("netexec"). Name("netexec").
Resource("pods"). Resource("pods").
SubResource("proxy").
Suffix("shell"). Suffix("shell").
Param("shellCommand", shellCommand). Param("shellCommand", shellCommand).
Do().Raw() 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 { return func(c *client.Client, podID string) error {
Logf("validating pod %s", podID) Logf("validating pod %s", podID)
body, err := c.Get(). body, err := c.Get().
Prefix("proxy").
Namespace(ns). Namespace(ns).
Resource("pods"). Resource("pods").
SubResource("proxy").
Name(podID). Name(podID).
Suffix("data.json"). Suffix("data.json").
Do(). Do().

View File

@ -118,8 +118,9 @@ func testPreStop(c *client.Client, ns string) {
// Validate that the server received the web poke. // Validate that the server received the web poke.
err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) { err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) {
if body, err := c.Get(). if body, err := c.Get().
Namespace(ns).Prefix("proxy"). Namespace(ns).
Resource("pods"). Resource("pods").
SubResource("proxy").
Name(podDescr.Name). Name(podDescr.Name).
Suffix("read"). Suffix("read").
DoRaw(); err != nil { DoRaw(); err != nil {

View File

@ -802,9 +802,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) 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(). body, err := r.c.Get().
Prefix("proxy").
Namespace(r.ns). Namespace(r.ns).
Resource("pods"). Resource("pods").
SubResource("proxy").
Name(string(pod.Name)). Name(string(pod.Name)).
Do(). Do().
Raw() Raw()

View File

@ -227,8 +227,8 @@ func testVolumeClient(client *client.Client, config VolumeTestConfig, volume api
By("reading a web page from the client") By("reading a web page from the client")
body, err := client.Get(). body, err := client.Get().
Namespace(config.namespace). Namespace(config.namespace).
Prefix("proxy").
Resource("pods"). Resource("pods").
SubResource("proxy").
Name(clientPod.Name). Name(clientPod.Name).
DoRaw() DoRaw()
expectNoError(err, "Cannot read web page: %v", err) expectNoError(err, "Cannot read web page: %v", err)