Search in sources :

Example 6 with LabelSelectorRequirement

use of io.fabric8.kubernetes.api.model.LabelSelectorRequirement 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));
}
Also used : DeploymentSpec(io.fabric8.kubernetes.api.model.extensions.DeploymentSpec) LabelSelector(io.fabric8.kubernetes.api.model.LabelSelector) LabelSelectorRequirement(io.fabric8.kubernetes.api.model.LabelSelectorRequirement)

Aggregations

LabelSelectorRequirement (io.fabric8.kubernetes.api.model.LabelSelectorRequirement)6 LabelSelector (io.fabric8.kubernetes.api.model.LabelSelector)3 ArrayList (java.util.ArrayList)2 DoneablePod (io.fabric8.kubernetes.api.model.DoneablePod)1 Pod (io.fabric8.kubernetes.api.model.Pod)1 PodList (io.fabric8.kubernetes.api.model.PodList)1 ReplicationControllerSpec (io.fabric8.kubernetes.api.model.ReplicationControllerSpec)1 ServiceSpec (io.fabric8.kubernetes.api.model.ServiceSpec)1 DeploymentSpec (io.fabric8.kubernetes.api.model.extensions.DeploymentSpec)1 ReplicaSetSpec (io.fabric8.kubernetes.api.model.extensions.ReplicaSetSpec)1 Watch (io.fabric8.kubernetes.client.Watch)1 Watcher (io.fabric8.kubernetes.client.Watcher)1 LogWatch (io.fabric8.kubernetes.client.dsl.LogWatch)1 DeploymentConfigSpec (io.fabric8.openshift.api.model.DeploymentConfigSpec)1