move the container name fix to NewTestPod to avoid breakage in other unit tests in the future

This commit is contained in:
James DeFelice 2015-06-15 14:30:48 +00:00
parent 5e4992aa5e
commit f956f23d37

View File

@ -344,7 +344,6 @@ func TestExecutorLaunchAndKillTask(t *testing.T) {
} }
pod := NewTestPod(1) pod := NewTestPod(1)
pod.Spec.Containers[0].Name = "foo"
podTask, err := podtask.New(api.NewDefaultContext(), "", podTask, err := podtask.New(api.NewDefaultContext(), "",
*pod, &mesosproto.ExecutorInfo{}) *pod, &mesosproto.ExecutorInfo{})
assert.Equal(t, nil, err, "must be able to create a task from a pod") assert.Equal(t, nil, err, "must be able to create a task from a pod")
@ -503,6 +502,7 @@ func NewTestPod(i int) *api.Pod {
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
{ {
Name: "foo",
Ports: []api.ContainerPort{ Ports: []api.ContainerPort{
{ {
ContainerPort: 8000 + i, ContainerPort: 8000 + i,