Search in sources :

Example 1 with KafkaSpecBuilder

use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi by strimzi.

the class KRaftUtilsTest method testValidKafka.

@ParallelTest
public void testValidKafka() {
    KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationTlsAuth().endKafkaListenerAuthenticationTlsAuth().build()).withNewEphemeralStorage().endEphemeralStorage().withNewKafkaAuthorizationOpa().withUrl("http://opa:8080").endKafkaAuthorizationOpa().endKafka().build();
    assertDoesNotThrow(() -> KRaftUtils.validateKafkaCrForKRaft(spec));
}
Also used : KafkaSpecBuilder(io.strimzi.api.kafka.model.KafkaSpecBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) KafkaSpec(io.strimzi.api.kafka.model.KafkaSpec) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 2 with KafkaSpecBuilder

use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi by strimzi.

the class KRaftUtilsTest method testInvalidKafka.

@ParallelTest
public void testInvalidKafka() {
    KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationScramSha512Auth().endKafkaListenerAuthenticationScramSha512Auth().build()).withNewJbodStorage().withVolumes(new PersistentClaimStorageBuilder().withId(0).withSize("100Gi").build(), new PersistentClaimStorageBuilder().withId(1).withSize("100Gi").build()).endJbodStorage().withNewKafkaAuthorizationSimple().endKafkaAuthorizationSimple().endKafka().build();
    InvalidResourceException ex = assertThrows(InvalidResourceException.class, () -> KRaftUtils.validateKafkaCrForKRaft(spec));
    assertThat(ex.getMessage(), is("Kafka configuration is not valid: [Authentication of type 'scram-sha-512` is currently not supported when the UseKRaft feature gate is enabled, Using more than one disk in a JBOD storage is currently not supported when the UseKRaft feature gate is enabled]"));
}
Also used : KafkaSpecBuilder(io.strimzi.api.kafka.model.KafkaSpecBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) PersistentClaimStorageBuilder(io.strimzi.api.kafka.model.storage.PersistentClaimStorageBuilder) KafkaSpec(io.strimzi.api.kafka.model.KafkaSpec) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 3 with KafkaSpecBuilder

use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi-kafka-operator by strimzi.

the class KRaftUtilsTest method testInvalidKafka.

@ParallelTest
public void testInvalidKafka() {
    KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationScramSha512Auth().endKafkaListenerAuthenticationScramSha512Auth().build()).withNewJbodStorage().withVolumes(new PersistentClaimStorageBuilder().withId(0).withSize("100Gi").build(), new PersistentClaimStorageBuilder().withId(1).withSize("100Gi").build()).endJbodStorage().withNewKafkaAuthorizationSimple().endKafkaAuthorizationSimple().endKafka().build();
    InvalidResourceException ex = assertThrows(InvalidResourceException.class, () -> KRaftUtils.validateKafkaCrForKRaft(spec));
    assertThat(ex.getMessage(), is("Kafka configuration is not valid: [Authentication of type 'scram-sha-512` is currently not supported when the UseKRaft feature gate is enabled, Using more than one disk in a JBOD storage is currently not supported when the UseKRaft feature gate is enabled]"));
}
Also used : KafkaSpecBuilder(io.strimzi.api.kafka.model.KafkaSpecBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) PersistentClaimStorageBuilder(io.strimzi.api.kafka.model.storage.PersistentClaimStorageBuilder) KafkaSpec(io.strimzi.api.kafka.model.KafkaSpec) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 4 with KafkaSpecBuilder

use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi-kafka-operator by strimzi.

the class KRaftUtilsTest method testValidKafka.

@ParallelTest
public void testValidKafka() {
    KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationTlsAuth().endKafkaListenerAuthenticationTlsAuth().build()).withNewEphemeralStorage().endEphemeralStorage().withNewKafkaAuthorizationOpa().withUrl("http://opa:8080").endKafkaAuthorizationOpa().endKafka().build();
    assertDoesNotThrow(() -> KRaftUtils.validateKafkaCrForKRaft(spec));
}
Also used : KafkaSpecBuilder(io.strimzi.api.kafka.model.KafkaSpecBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) KafkaSpec(io.strimzi.api.kafka.model.KafkaSpec) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

KafkaSpec (io.strimzi.api.kafka.model.KafkaSpec)4 KafkaSpecBuilder (io.strimzi.api.kafka.model.KafkaSpecBuilder)4 GenericKafkaListenerBuilder (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder)4 ParallelTest (io.strimzi.test.annotations.ParallelTest)4 PersistentClaimStorageBuilder (io.strimzi.api.kafka.model.storage.PersistentClaimStorageBuilder)2