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.
func rebootNode(c *client.Client, provider, name, rebootCmd string, result chan bool) {
// Setup
ns := api.NamespaceDefault
ns := api.NamespaceSystem
ps := newPodStore(c, ns, labels.Everything(), fields.OneTermEqualSelector(client.PodHost, name))
defer ps.Stop()

View File

@ -64,7 +64,7 @@ var _ = Describe("Restart", func() {
SkipUnlessProviderIs("gce", "gke")
skipped = false
ps = newPodStore(c, api.NamespaceDefault, labels.Everything(), fields.Everything())
ps = newPodStore(c, api.NamespaceSystem, labels.Everything(), fields.Everything())
})
AfterEach(func() {
@ -89,7 +89,7 @@ var _ = Describe("Restart", func() {
for i, p := range pods {
podNamesBefore[i] = p.ObjectMeta.Name
}
ns := api.NamespaceDefault
ns := api.NamespaceSystem
if !checkPodsRunningReady(c, ns, podNamesBefore, podReadyBeforeTimeout) {
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.
// 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) {
@ -1224,7 +1218,7 @@ func dumpNodeDebugInfo(c *client.Client, nodeNames []string) {
// restart and node unhealthy events. Note that listing events like this will mess
// with latency metrics, beware of calling it during a test.
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(),
fields.Set{
"involvedObject.kind": "Node",