(t *testing.T, num int, dir string, parent entity.Entity)
| 155 | } |
| 156 | |
| 157 | func testWriteAndAttachRandomContainers(t *testing.T, num int, dir string, parent entity.Entity) { |
| 158 | for i := 0; i < num; i++ { |
| 159 | name := randomString(8) |
| 160 | |
| 161 | kubeContainer := kube.Container{ |
| 162 | Name: name, |
| 163 | Image: randomString(6), |
| 164 | ImagePullPolicy: kube.PullAlways, |
| 165 | TerminationMessagePath: kube.TerminationMessagePathDefault, |
| 166 | } |
| 167 | filename := path.Join(dir, name+ContainerExtension) |
| 168 | |
| 169 | container, err := entity.NewContainer(kubeContainer, kube.ObjectMeta{}, filename) |
| 170 | assert.NoError(t, err) |
| 171 | |
| 172 | testWriteYAMLToFile(t, filename, &kubeContainer) |
| 173 | |
| 174 | assert.NoError(t, parent.Attach(container), "should be able to attach container to pod") |
| 175 | } |
| 176 | } |
nothing calls this directly
no test coverage detected