use of io.fabric8.kubernetes.api.model.apps.DeploymentSpec in project flink by apache.
the class KubernetesJobManagerFactoryTest method testDeploymentSpec.
@Test
public void testDeploymentSpec() throws IOException {
kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
final DeploymentSpec resultDeploymentSpec = this.kubernetesJobManagerSpecification.getDeployment().getSpec();
assertEquals(1, resultDeploymentSpec.getReplicas().intValue());
final Map<String, String> expectedLabels = new HashMap<>(getCommonLabels());
expectedLabels.put(Constants.LABEL_COMPONENT_KEY, Constants.LABEL_COMPONENT_JOB_MANAGER);
assertEquals(expectedLabels, resultDeploymentSpec.getSelector().getMatchLabels());
expectedLabels.putAll(userLabels);
assertEquals(expectedLabels, resultDeploymentSpec.getTemplate().getMetadata().getLabels());
assertThat(resultDeploymentSpec.getTemplate().getMetadata().getAnnotations(), equalTo(userAnnotations));
assertNotNull(resultDeploymentSpec.getTemplate().getSpec());
}
Aggregations