@Test public void checkKafkaJbodStorage() { Kafka kafka = new KafkaBuilder(ResourceUtils.createKafka(NAMESPACE, NAME, 1, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), new JbodStorageBuilder().withVolumes(new EphemeralStorageBuilder().withId(1).build(), new EphemeralStorageBuilder().withId(2).build()).build(), new EphemeralStorage(), null, null, null, null)) .editSpec() .editZookeeper() .withReplicas(3) .endZookeeper() .endSpec() .build(); KafkaSpecChecker checker = generateChecker(kafka); List<Condition> warnings = checker.run(); assertThat(warnings, hasSize(1)); Condition warning = warnings.get(0); assertThat(warning.getReason(), is("KafkaStorage")); assertThat(warning.getStatus(), is("True")); assertThat(warning.getMessage(), is("A Kafka cluster with a single replica and ephemeral storage will lose topic messages after any restart or rolling update.")); }
public List<Condition> run() { List<Condition> warnings = new ArrayList<>(); checkKafkaLogMessageFormatVersion(warnings); checkKafkaStorage(warnings); checkZooKeeperStorage(warnings); checkZooKeeperReplicas(warnings); return warnings; }
KafkaSpecChecker { public List<Condition> run() { List<Condition> warnings = new ArrayList<>(); checkKafkaLogMessageFormatVersion(warnings); checkKafkaStorage(warnings); checkZooKeeperStorage(warnings); checkZooKeeperReplicas(warnings); return warnings; } }
KafkaSpecChecker { public List<Condition> run() { List<Condition> warnings = new ArrayList<>(); checkKafkaLogMessageFormatVersion(warnings); checkKafkaStorage(warnings); checkZooKeeperStorage(warnings); checkZooKeeperReplicas(warnings); return warnings; } KafkaSpecChecker(KafkaSpec spec, KafkaCluster kafkaCluster, ZookeeperCluster zkCluster); }
KafkaSpecChecker { public List<Condition> run() { List<Condition> warnings = new ArrayList<>(); checkKafkaLogMessageFormatVersion(warnings); checkKafkaStorage(warnings); checkZooKeeperStorage(warnings); checkZooKeeperReplicas(warnings); return warnings; } KafkaSpecChecker(KafkaSpec spec, KafkaCluster kafkaCluster, ZookeeperCluster zkCluster); List<Condition> run(); }
KafkaSpecChecker { public List<Condition> run() { List<Condition> warnings = new ArrayList<>(); checkKafkaLogMessageFormatVersion(warnings); checkKafkaStorage(warnings); checkZooKeeperStorage(warnings); checkZooKeeperReplicas(warnings); return warnings; } KafkaSpecChecker(KafkaSpec spec, KafkaCluster kafkaCluster, ZookeeperCluster zkCluster); List<Condition> run();  }