use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.
the class KafkaRollerTest method testRollHandlesErrorWhenClosingAdminClient.
@Test
public void testRollHandlesErrorWhenClosingAdminClient(VertxTestContext testContext) {
PodOperator podOps = mockPodOps(podId -> succeededFuture());
StatefulSet sts = buildStatefulSet();
TestingKafkaRoller kafkaRoller = new TestingKafkaRoller(sts, null, null, addPodNames(sts.getSpec().getReplicas()), podOps, noException(), new RuntimeException("Test Exception"), noException(), noException(), noException(), brokerId -> succeededFuture(true), 2);
// The algorithm should carry on rolling the pods (errors are logged),
// because we did the controller we controller last order
doSuccessfulRollingRestart(testContext, kafkaRoller, asList(0, 1, 2, 3, 4), asList(0, 1, 3, 4, 2));
}
use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.
the class KafkaRollerTest method testRollWithNoController.
@Test
public void testRollWithNoController(VertxTestContext testContext) {
PodOperator podOps = mockPodOps(podId -> succeededFuture());
StatefulSet sts = buildStatefulSet();
TestingKafkaRoller kafkaRoller = rollerWithControllers(sts, podOps, -1);
doSuccessfulRollingRestart(testContext, kafkaRoller, asList(0, 1, 2, 3, 4), asList(0, 1, 2, 3, 4));
}
use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.
the class KafkaRollerTest method testSuccessfulAlteringConfigNotRoll.
@Test
public void testSuccessfulAlteringConfigNotRoll(VertxTestContext testContext) {
PodOperator podOps = mockPodOps(podId -> succeededFuture());
StatefulSet sts = buildStatefulSet();
TestingKafkaRoller kafkaRoller = new TestingKafkaRoller(sts, null, null, addPodNames(sts.getSpec().getReplicas()), podOps, noException(), null, noException(), noException(), noException(), brokerId -> succeededFuture(true), 2);
// The algorithm should carry on rolling the pods
doSuccessfulConfigUpdate(testContext, kafkaRoller, emptyList());
}
use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.
the class KafkaRollerTest method tesRollWithtAControllerChange.
@Test
public void tesRollWithtAControllerChange(VertxTestContext testContext) {
PodOperator podOps = mockPodOps(podId -> succeededFuture());
StatefulSet sts = buildStatefulSet();
TestingKafkaRoller kafkaRoller = rollerWithControllers(sts, podOps, 0, 1);
doSuccessfulRollingRestart(testContext, kafkaRoller, asList(0, 1, 2, 3, 4), asList(2, 3, 4, 0, 1));
}
use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.
the class KafkaRollerTest method testRollHandlesErrorWhenGettingControllerFromNonController.
@Test
public void testRollHandlesErrorWhenGettingControllerFromNonController(VertxTestContext testContext) {
int controller = 2;
int nonController = 1;
PodOperator podOps = mockPodOps(podId -> succeededFuture());
StatefulSet sts = buildStatefulSet();
TestingKafkaRoller kafkaRoller = new TestingKafkaRoller(sts, null, null, addPodNames(sts.getSpec().getReplicas()), podOps, noException(), null, podId -> podId == nonController ? new RuntimeException("Test Exception") : null, noException(), noException(), brokerId -> succeededFuture(true), controller);
// The algorithm should carry on rolling the pods (errors are logged),
// because we never find the controller we get ascending order
doSuccessfulRollingRestart(testContext, kafkaRoller, asList(0, 1, 2, 3, 4), asList(0, 3, 4, nonController, controller));
}
Aggregations