use of com.netflix.titus.api.jobmanager.model.job.NetworkConfiguration in project titus-control-plane by Netflix.
the class V1SpecPodFactoryTest method testNetworkConfigurationRespectsBeingSet.
@Test
public void testNetworkConfigurationRespectsBeingSet() {
Job<BatchJobExt> job = JobGenerator.oneBatchJob();
BatchJobTask task = JobGenerator.oneBatchTask();
NetworkConfiguration networkConfiguration = new NetworkConfiguration(3);
job = job.toBuilder().withJobDescriptor(job.getJobDescriptor().toBuilder().withNetworkConfiguration(networkConfiguration).build()).build();
when(podAffinityFactory.buildV1Affinity(job, task)).thenReturn(Pair.of(new V1Affinity(), new HashMap<>()));
V1Pod pod = podFactory.buildV1Pod(job, task);
String networkModeAnnotationValue = pod.getMetadata().getAnnotations().get("network.netflix.com/network-mode");
assertThat(networkModeAnnotationValue).isEqualTo("Ipv6AndIpv4Fallback");
}
Aggregations