use of io.strimzi.api.kafka.model.storage.EphemeralStorage in project strimzi-kafka-operator by strimzi.
the class KafkaSpecCheckerTest method checkLogMessageFormatWithRightVersion.
@Test
public void checkLogMessageFormatWithRightVersion() {
Map<String, Object> kafkaOptions = new HashMap<>();
kafkaOptions.put(KafkaConfiguration.LOG_MESSAGE_FORMAT_VERSION, KafkaVersionTestUtils.LATEST_FORMAT_VERSION);
kafkaOptions.put(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR, 3);
kafkaOptions.put(KafkaConfiguration.MIN_INSYNC_REPLICAS, 2);
Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 3, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, null, kafkaOptions, emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null);
KafkaSpecChecker checker = generateChecker(kafka);
List<Condition> warnings = checker.run();
assertThat(warnings, hasSize(0));
}
use of io.strimzi.api.kafka.model.storage.EphemeralStorage in project strimzi-kafka-operator by strimzi.
the class KafkaSpecCheckerTest method checkReplicationFactorAndMinInsyncReplicasNotSet.
@Test
public void checkReplicationFactorAndMinInsyncReplicasNotSet() {
Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 3, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, null, emptyMap(), emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null);
KafkaSpecChecker checker = generateChecker(kafka);
List<Condition> warnings = checker.run();
assertThat(warnings, hasSize(2));
assertThat(warnings.stream().anyMatch(w -> w.getMessage().contains(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR)), is(true));
assertThat(warnings.stream().anyMatch(w -> w.getMessage().contains(KafkaConfiguration.MIN_INSYNC_REPLICAS)), is(true));
}
use of io.strimzi.api.kafka.model.storage.EphemeralStorage in project strimzi-kafka-operator by strimzi.
the class KafkaSpecCheckerTest method checkZookeeperReplicas.
@Test
public void checkZookeeperReplicas() {
Map<String, Object> kafkaOptions = new HashMap<>();
kafkaOptions.put(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR, 2);
kafkaOptions.put(KafkaConfiguration.MIN_INSYNC_REPLICAS, 1);
Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 2, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, null, kafkaOptions, emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null);
KafkaSpecChecker checker = generateChecker(kafka);
List<Condition> warnings = checker.run();
assertThat(warnings, hasSize(1));
Condition warning = warnings.get(0);
assertThat(warning.getReason(), is("ZooKeeperReplicas"));
assertThat(warning.getStatus(), is("True"));
assertThat(warning.getMessage(), is("Running ZooKeeper with two nodes is not advisable as both replicas will be needed to avoid downtime. It is recommended that a minimum of three replicas are used."));
}
use of io.strimzi.api.kafka.model.storage.EphemeralStorage in project strimzi-kafka-operator by strimzi.
the class KafkaSpecCheckerTest method checkLogMessageFormatWithRightLongVersion.
@Test
public void checkLogMessageFormatWithRightLongVersion() {
Map<String, Object> kafkaOptions = new HashMap<>();
kafkaOptions.put(KafkaConfiguration.LOG_MESSAGE_FORMAT_VERSION, KafkaVersionTestUtils.LATEST_FORMAT_VERSION + "-IV0");
kafkaOptions.put(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR, 3);
kafkaOptions.put(KafkaConfiguration.MIN_INSYNC_REPLICAS, 2);
Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 3, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, null, kafkaOptions, emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null);
KafkaSpecChecker checker = generateChecker(kafka);
List<Condition> warnings = checker.run();
assertThat(warnings, hasSize(0));
}
use of io.strimzi.api.kafka.model.storage.EphemeralStorage in project strimzi-kafka-operator by strimzi.
the class KafkaSpecCheckerTest method checkReplicationFactorAndMinInsyncReplicasSet.
@Test
public void checkReplicationFactorAndMinInsyncReplicasSet() {
Map<String, Object> kafkaOptions = new HashMap<>();
kafkaOptions.put(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR, 3);
kafkaOptions.put(KafkaConfiguration.MIN_INSYNC_REPLICAS, 2);
Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 3, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, null, kafkaOptions, emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null);
KafkaSpecChecker checker = generateChecker(kafka);
List<Condition> warnings = checker.run();
assertThat(warnings, hasSize(0));
}
Aggregations