Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pod get logs test #31632

Merged
merged 1 commit into from
Aug 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions test/e2e/common/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,17 +530,13 @@ var _ = framework.KubeDescribe("Pods", func() {
{
Name: "main",
Image: "gcr.io/google_containers/busybox:1.24",
Command: []string{"/bin/sh", "-c", "echo container is alive; sleep 600"},
Command: []string{"/bin/sh", "-c", "echo container is alive; sleep 10000"},
},
},
},
}

By("submitting the pod to kubernetes")
defer func() {
By("deleting the pod")
podClient.Delete(pod.Name, api.NewDeleteOptions(0))
}()
podClient.CreateSync(pod)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any concern about leaking resources here? Add a TODO to add the defer back?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test namespaces will get cleaned up automatically. So I don't see a concern. In-fact it is preferable to not auto-delete unless deletion is part of the test's goals.


req := f.Client.Get().
Expand All @@ -566,7 +562,7 @@ var _ = framework.KubeDescribe("Pods", func() {
}
framework.Failf("Failed to read completely from websocket %s: %v", url.String(), err)
}
if len(msg) == 0 {
if len(strings.TrimSpace(string(msg))) == 0 {
continue
}
buf.Write(msg)
Expand Down