use of io.stackgres.common.crd.Toleration in project stackgres by ongres.
the class ClusterConstraintValidatorTest method invalidTolerationEffect_shouldFail.
@Test
void invalidTolerationEffect_shouldFail() {
StackGresClusterReview review = getValidReview();
review.getRequest().getObject().getSpec().getPod().setScheduling(new StackGresClusterPodScheduling());
review.getRequest().getObject().getSpec().getPod().getScheduling().setTolerations(new ArrayList<>());
review.getRequest().getObject().getSpec().getPod().getScheduling().getTolerations().add(new Toleration());
review.getRequest().getObject().getSpec().getPod().getScheduling().getTolerations().get(0).setKey("test");
review.getRequest().getObject().getSpec().getPod().getScheduling().getTolerations().get(0).setEffect("NeverSchedule");
checkErrorCause(Toleration.class, "spec.pod.scheduling.tolerations[0].effect", "isEffectValid", review, AssertTrue.class);
}
use of io.stackgres.common.crd.Toleration in project stackgres by ongres.
the class ClusterConstraintValidatorTest method invalidTolerationKeyEmpty_shouldFail.
@Test
void invalidTolerationKeyEmpty_shouldFail() {
StackGresClusterReview review = getValidReview();
review.getRequest().getObject().getSpec().getPod().setScheduling(new StackGresClusterPodScheduling());
review.getRequest().getObject().getSpec().getPod().getScheduling().setTolerations(new ArrayList<>());
review.getRequest().getObject().getSpec().getPod().getScheduling().getTolerations().add(new Toleration());
review.getRequest().getObject().getSpec().getPod().getScheduling().getTolerations().get(0).setKey("");
checkErrorCause(Toleration.class, new String[] { "spec.pod.scheduling.tolerations[0].key", "spec.pod.scheduling.tolerations[0].operator" }, "isOperatorExistsWhenKeyIsEmpty", review, AssertTrue.class);
}
Aggregations