use of io.fabric8.kubernetes.api.model.extensions.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());
}
use of io.fabric8.kubernetes.api.model.extensions.DeploymentSpec in project fabric8 by fabric8io.
the class DeploymentPodsAssert method pods.
@Override
public PodSelectionAssert pods() {
spec().isNotNull().selector().isNotNull();
DeploymentSpec spec = this.actual.getSpec();
Integer replicas = spec.getReplicas();
LabelSelector selector = spec.getSelector();
Map<String, String> matchLabels = selector.getMatchLabels();
List<LabelSelectorRequirement> matchExpressions = selector.getMatchExpressions();
return new PodSelectionAssert(client, replicas, matchLabels, matchExpressions, "DeploymentConfig " + KubernetesHelper.getName(actual));
}
Aggregations