@Test public void testKubeBackendAffinity() { Pair<V1Affinity, Map<String, String>> affinityWithAnnotations = factory.buildV1Affinity( newJobWithHardConstraint(JobConstraints.KUBE_BACKEND, "kublet"), JobGenerator.oneBatchTask() ); V1NodeSelector nodeSelector = affinityWithAnnotations.getLeft().getNodeAffinity().getRequiredDuringSchedulingIgnoredDuringExecution(); assertThat(nodeSelector.getNodeSelectorTerms()).hasSize(1); V1NodeSelectorRequirement requirement = nodeSelector.getNodeSelectorTerms().get(0).getMatchExpressions().get(0); assertThat(requirement.getKey()).isEqualTo(KubeConstants.TAINT_KUBE_BACKEND); assertThat(requirement.getValues()).contains("kublet"); }
@Override public Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task) { return new Processor(job).build(); }
DefaultPodAffinityFactory implements PodAffinityFactory { @Override public Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task) { return new Processor(job).build(); } }
DefaultPodAffinityFactory implements PodAffinityFactory { @Override public Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task) { return new Processor(job).build(); } @Inject  DefaultPodAffinityFactory(DirectKubeConfiguration configuration,
                                     PodResourcePoolResolver podResourcePoolResolver); }
DefaultPodAffinityFactory implements PodAffinityFactory { @Override public Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task) { return new Processor(job).build(); } @Inject  DefaultPodAffinityFactory(DirectKubeConfiguration configuration,
                                     PodResourcePoolResolver podResourcePoolResolver); @Override Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task); }
DefaultPodAffinityFactory implements PodAffinityFactory { @Override public Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task) { return new Processor(job).build(); } @Inject  DefaultPodAffinityFactory(DirectKubeConfiguration configuration,
                                     PodResourcePoolResolver podResourcePoolResolver); @Override Pair<V1Affinity, Map<String, String>> buildV1Affinity(Job<?> job, Task task);  }