Merge pull request #18773 from ihmccreery/fix-upgrade-proxy

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-12-19 21:10:34 -08:00
6 changed files with 207 additions and 62 deletions

View File

@@ -130,14 +130,29 @@ func assertFilesExist(fileNames []string, fileDir string, pod *api.Pod, client *
expectNoError(wait.Poll(time.Second*2, time.Second*60, func() (bool, error) {
failed = []string{}
subResourceProxyAvailable, err := serverVersionGTE(subResourceProxyVersion, client)
if err != nil {
return false, err
}
for _, fileName := range fileNames {
if _, err := client.Get().
Namespace(pod.Namespace).
Resource("pods").
SubResource("proxy").
Name(pod.Name).
Suffix(fileDir, fileName).
Do().Raw(); err != nil {
if subResourceProxyAvailable {
_, err = client.Get().
Namespace(pod.Namespace).
Resource("pods").
SubResource("proxy").
Name(pod.Name).
Suffix(fileDir, fileName).
Do().Raw()
} else {
_, err = client.Get().
Prefix("proxy").
Resource("pods").
Namespace(pod.Namespace).
Name(pod.Name).
Suffix(fileDir, fileName).
Do().Raw()
}
if err != nil {
Logf("Unable to read %s from pod %s: %v", fileName, pod.Name, err)
failed = append(failed, fileName)
}