Merge pull request #11080 from satnam6502/reboot

Fix reboot test to use system namespace
This commit is contained in:
Tim Hockin 2015-07-12 15:17:53 -07:00
commit ea9272c4b7
3 changed files with 4 additions and 10 deletions

View File

@ -156,7 +156,7 @@ func issueSSHCommand(node *api.Node, provider, cmd string) error {
// failed step, it will return false through result and not run the rest. // failed step, it will return false through result and not run the rest.
func rebootNode(c *client.Client, provider, name, rebootCmd string, result chan bool) { func rebootNode(c *client.Client, provider, name, rebootCmd string, result chan bool) {
// Setup // Setup
ns := api.NamespaceDefault ns := api.NamespaceSystem
ps := newPodStore(c, ns, labels.Everything(), fields.OneTermEqualSelector(client.PodHost, name)) ps := newPodStore(c, ns, labels.Everything(), fields.OneTermEqualSelector(client.PodHost, name))
defer ps.Stop() defer ps.Stop()

View File

@ -64,7 +64,7 @@ var _ = Describe("Restart", func() {
SkipUnlessProviderIs("gce", "gke") SkipUnlessProviderIs("gce", "gke")
skipped = false skipped = false
ps = newPodStore(c, api.NamespaceDefault, labels.Everything(), fields.Everything()) ps = newPodStore(c, api.NamespaceSystem, labels.Everything(), fields.Everything())
}) })
AfterEach(func() { AfterEach(func() {
@ -89,7 +89,7 @@ var _ = Describe("Restart", func() {
for i, p := range pods { for i, p := range pods {
podNamesBefore[i] = p.ObjectMeta.Name podNamesBefore[i] = p.ObjectMeta.Name
} }
ns := api.NamespaceDefault ns := api.NamespaceSystem
if !checkPodsRunningReady(c, ns, podNamesBefore, podReadyBeforeTimeout) { if !checkPodsRunningReady(c, ns, podNamesBefore, podReadyBeforeTimeout) {
Failf("At least one pod wasn't running and ready at test start.") Failf("At least one pod wasn't running and ready at test start.")
} }

View File

@ -551,12 +551,6 @@ func waitForPodSuccessInNamespace(c *client.Client, podName string, contName str
}) })
} }
// waitForPodSuccess returns nil if the pod reached state success, or an error if it reached failure or ran too long.
// The default namespace is used to identify pods.
func waitForPodSuccess(c *client.Client, podName string, contName string) error {
return waitForPodSuccessInNamespace(c, podName, contName, api.NamespaceDefault)
}
// waitForRCPodOnNode returns the pod from the given replication controller (decribed by rcName) which is scheduled on the given node. // waitForRCPodOnNode returns the pod from the given replication controller (decribed by rcName) which is scheduled on the given node.
// In case of failure or too long waiting time, an error is returned. // In case of failure or too long waiting time, an error is returned.
func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, error) { func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, error) {
@ -1224,7 +1218,7 @@ func dumpNodeDebugInfo(c *client.Client, nodeNames []string) {
// restart and node unhealthy events. Note that listing events like this will mess // restart and node unhealthy events. Note that listing events like this will mess
// with latency metrics, beware of calling it during a test. // with latency metrics, beware of calling it during a test.
func getNodeEvents(c *client.Client, nodeName string) []api.Event { func getNodeEvents(c *client.Client, nodeName string) []api.Event {
events, err := c.Events(api.NamespaceDefault).List( events, err := c.Events(api.NamespaceSystem).List(
labels.Everything(), labels.Everything(),
fields.Set{ fields.Set{
"involvedObject.kind": "Node", "involvedObject.kind": "Node",