Port the downward api test to the node e2e suite
Also extend the framework to allow a custom client config loading function, so that the node e2e suite can reuse the same framework across tests.
This commit is contained in:
@@ -197,10 +197,6 @@ func waitForPodRunning(c *client.Client, ns string, name string) error {
|
||||
return fmt.Errorf("Time out while waiting for pod %s/%s to become running; current status: %+v", ns, name, pod.Status)
|
||||
}
|
||||
|
||||
func setNodeNameForPod(pod *api.Pod) {
|
||||
pod.Spec.NodeName = *nodeName
|
||||
}
|
||||
|
||||
func createPodAndWaitUntilRunning(c *client.Client, pod *api.Pod) *api.Pod {
|
||||
ref := fmt.Sprintf("%v/%v", pod.Namespace, pod.Name)
|
||||
_, err := createPodWithSpec(c, pod)
|
||||
@@ -215,8 +211,7 @@ func createPodAndWaitUntilRunning(c *client.Client, pod *api.Pod) *api.Pod {
|
||||
func createPodWithSpec(c *client.Client, pod *api.Pod) (*api.Pod, error) {
|
||||
// Manually assign pod to node because we don't run the scheduler in node
|
||||
// e2e tests.
|
||||
// TODO: This should also be a shared utility function.
|
||||
setNodeNameForPod(pod)
|
||||
assignPodToNode(pod)
|
||||
createdPod, err := c.Pods(pod.Namespace).Create(pod)
|
||||
return createdPod, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user