make kubectl logs work for replication controllers

This commit is contained in:
deads2k
2016-02-16 15:21:35 -05:00
parent d2ee8f7e0d
commit f8f45df578
2 changed files with 54 additions and 8 deletions

View File

@@ -464,7 +464,7 @@ var _ = Describe("Kubectl client", func() {
withStdinData("abcd1234\n").
execOrDie()
Expect(runOutput).ToNot(ContainSubstring("stdin closed"))
runTestPod, err := util.GetFirstPod(c, ns, labels.SelectorFromSet(map[string]string{"run": "run-test-3"}))
runTestPod, _, err := util.GetFirstPod(c, ns, labels.SelectorFromSet(map[string]string{"run": "run-test-3"}))
if err != nil {
os.Exit(1)
}
@@ -898,6 +898,13 @@ var _ = Describe("Kubectl client", func() {
runKubectlOrDie("get", "pods", "-L", "run", nsFlag)
Failf("Failed creating 1 pod with expected image %s. Number of pods = %v", nginxImage, len(pods))
}
By("confirm that you can get logs from an rc")
_, err = runKubectl("logs", "rc/"+rcName, nsFlag)
// a non-nil error is fine as long as we actually found a pod.
if err != nil && !strings.Contains(err.Error(), " in pod ") {
Failf("Failed getting logs by rc %s: %v", rcName, err)
}
})
})