@Test public void checkKafkaVersion() { Map<String, Object> kafkaOptions = new HashMap<>(); kafkaOptions.put(KafkaConfiguration.LOG_MESSAGE_FORMAT_VERSION, KafkaVersionTestUtils.PREVIOUS_FORMAT_VERSION); Kafka kafka = new KafkaBuilder(ResourceUtils.createKafka(NAMESPACE, NAME, 3, IMAGE, HEALTH_DELAY, HEALTH_TIMEOUT, Collections.emptyMap(), kafkaOptions, Collections.emptyMap(), new EphemeralStorage(), new EphemeralStorage(), null, null, null, null)) .editSpec() .editKafka() .withVersion(KafkaVersionTestUtils.LATEST_KAFKA_VERSION) .endKafka() .endSpec() .build(); KafkaSpecChecker checker = generateChecker(kafka); List<Condition> warnings = checker.run(); assertThat(warnings, hasSize(1)); Condition warning = warnings.get(0); assertThat(warning.getReason(), is("KafkaLogMessageFormatVersion")); assertThat(warning.getStatus(), is("True")); assertThat(warning.getMessage(), is("log.message.format.version does not match the Kafka cluster version, which suggests that an upgrade is incomplete.")); }
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();  }