Search in sources :

Example 71 with PodOperator

use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.

the class KafkaAssemblyOperatorNonParametrizedTest method testClientsCASecretsWithoutOwnerReference.

@Test
public void testClientsCASecretsWithoutOwnerReference(VertxTestContext context) {
    OwnerReference ownerReference = new OwnerReferenceBuilder().withKind("Kafka").withName(NAME).withBlockOwnerDeletion(false).withController(false).build();
    CertificateAuthority caConfig = new CertificateAuthority();
    caConfig.setGenerateSecretOwnerReference(false);
    Kafka kafka = new KafkaBuilder().withNewMetadata().withName(NAME).withNamespace(NAMESPACE).endMetadata().withNewSpec().withNewKafka().withReplicas(3).withNewEphemeralStorage().endEphemeralStorage().endKafka().withClientsCa(caConfig).withNewZookeeper().withReplicas(3).withNewEphemeralStorage().endEphemeralStorage().endZookeeper().endSpec().build();
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    SecretOperator secretOps = supplier.secretOperations;
    PodOperator podOps = supplier.podOperations;
    ArgumentCaptor<Secret> clusterCaCert = ArgumentCaptor.forClass(Secret.class);
    ArgumentCaptor<Secret> clusterCaKey = ArgumentCaptor.forClass(Secret.class);
    ArgumentCaptor<Secret> clientsCaCert = ArgumentCaptor.forClass(Secret.class);
    ArgumentCaptor<Secret> clientsCaKey = ArgumentCaptor.forClass(Secret.class);
    when(secretOps.reconcile(any(), eq(NAMESPACE), eq(AbstractModel.clusterCaCertSecretName(NAME)), clusterCaCert.capture())).thenAnswer(i -> Future.succeededFuture(ReconcileResult.created(i.getArgument(0))));
    when(secretOps.reconcile(any(), eq(NAMESPACE), eq(AbstractModel.clusterCaKeySecretName(NAME)), clusterCaKey.capture())).thenAnswer(i -> Future.succeededFuture(ReconcileResult.created(i.getArgument(0))));
    when(secretOps.reconcile(any(), eq(NAMESPACE), eq(KafkaResources.clientsCaCertificateSecretName(NAME)), clientsCaCert.capture())).thenAnswer(i -> Future.succeededFuture(ReconcileResult.created(i.getArgument(0))));
    when(secretOps.reconcile(any(), eq(NAMESPACE), eq(KafkaResources.clientsCaKeySecretName(NAME)), clientsCaKey.capture())).thenAnswer(i -> Future.succeededFuture(ReconcileResult.created(i.getArgument(0))));
    when(secretOps.reconcile(any(), eq(NAMESPACE), eq(ClusterOperator.secretName(NAME)), any())).thenAnswer(i -> Future.succeededFuture(ReconcileResult.created(i.getArgument(0))));
    when(podOps.listAsync(eq(NAMESPACE), any(Labels.class))).thenReturn(Future.succeededFuture(List.of()));
    KafkaAssemblyOperator op = new KafkaAssemblyOperator(vertx, new PlatformFeaturesAvailability(false, KubernetesVersion.V1_16), certManager, passwordGenerator, supplier, ResourceUtils.dummyClusterOperatorConfig(1L));
    Reconciliation reconciliation = new Reconciliation("test-trigger", Kafka.RESOURCE_KIND, NAMESPACE, NAME);
    Checkpoint async = context.checkpoint();
    op.new ReconciliationState(reconciliation, kafka).reconcileCas(() -> new Date()).onComplete(context.succeeding(c -> context.verify(() -> {
        assertThat(clusterCaCert.getAllValues(), hasSize(1));
        assertThat(clusterCaKey.getAllValues(), hasSize(1));
        assertThat(clientsCaCert.getAllValues(), hasSize(1));
        assertThat(clientsCaKey.getAllValues(), hasSize(1));
        Secret clusterCaCertSecret = clusterCaCert.getValue();
        Secret clusterCaKeySecret = clusterCaKey.getValue();
        Secret clientsCaCertSecret = clientsCaCert.getValue();
        Secret clientsCaKeySecret = clientsCaKey.getValue();
        assertThat(clusterCaCertSecret.getMetadata().getOwnerReferences(), hasSize(1));
        assertThat(clusterCaKeySecret.getMetadata().getOwnerReferences(), hasSize(1));
        assertThat(clientsCaCertSecret.getMetadata().getOwnerReferences(), hasSize(0));
        assertThat(clientsCaKeySecret.getMetadata().getOwnerReferences(), hasSize(0));
        assertThat(clusterCaCertSecret.getMetadata().getOwnerReferences().get(0), is(ownerReference));
        assertThat(clusterCaKeySecret.getMetadata().getOwnerReferences().get(0), is(ownerReference));
        async.flag();
    })));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) Date(java.util.Date) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ClusterRoleBindingOperator(io.strimzi.operator.common.operator.resource.ClusterRoleBindingOperator) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) AfterAll(org.junit.jupiter.api.AfterAll) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Collections.singleton(java.util.Collections.singleton) KafkaResources(io.strimzi.api.kafka.model.KafkaResources) BeforeAll(org.junit.jupiter.api.BeforeAll) Map(java.util.Map) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) ResourceUtils(io.strimzi.operator.cluster.ResourceUtils) AbstractModel(io.strimzi.operator.cluster.model.AbstractModel) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Test(org.junit.jupiter.api.Test) List(java.util.List) Labels(io.strimzi.operator.common.model.Labels) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) Secret(io.fabric8.kubernetes.api.model.Secret) Checkpoint(io.vertx.junit5.Checkpoint) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) ClusterOperatorConfig(io.strimzi.operator.cluster.ClusterOperatorConfig) VertxTestContext(io.vertx.junit5.VertxTestContext) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ClusterRoleBinding(io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding) CoreMatchers.not(org.hamcrest.CoreMatchers.not) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) ArgumentCaptor(org.mockito.ArgumentCaptor) ClusterOperator(io.strimzi.operator.cluster.ClusterOperator) KafkaVersionTestUtils(io.strimzi.operator.cluster.KafkaVersionTestUtils) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) Matchers.hasSize(org.hamcrest.Matchers.hasSize) ReconcileResult(io.strimzi.operator.common.operator.resource.ReconcileResult) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) CertificateAuthority(io.strimzi.api.kafka.model.CertificateAuthority) OwnerReferenceBuilder(io.fabric8.kubernetes.api.model.OwnerReferenceBuilder) KubernetesVersion(io.strimzi.operator.KubernetesVersion) Vertx(io.vertx.core.Vertx) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Reconciliation(io.strimzi.operator.common.Reconciliation) Mockito(org.mockito.Mockito) Kafka(io.strimzi.api.kafka.model.Kafka) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) OwnerReferenceBuilder(io.fabric8.kubernetes.api.model.OwnerReferenceBuilder) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) Labels(io.strimzi.operator.common.model.Labels) Date(java.util.Date) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) Checkpoint(io.vertx.junit5.Checkpoint) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) Reconciliation(io.strimzi.operator.common.Reconciliation) CertificateAuthority(io.strimzi.api.kafka.model.CertificateAuthority) Test(org.junit.jupiter.api.Test)

Example 72 with PodOperator

use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.

the class KafkaReconcilerStatusTest method testKafkaReconcilerStatusWithNodePortsWithPreferredAddressType.

@Test
public void testKafkaReconcilerStatusWithNodePortsWithPreferredAddressType(VertxTestContext context) {
    Kafka kafka = new KafkaBuilder(KAFKA).editOrNewSpec().editOrNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.NODEPORT).withTls(true).withNewConfiguration().withPreferredNodePortAddressType(NodeAddressType.INTERNAL_DNS).endConfiguration().build()).endKafka().endSpec().build();
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    // Mock the secrets needed for Kafka client
    SecretOperator mockSecretOps = supplier.secretOperations;
    Secret secret = new Secret();
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(KafkaResources.clusterCaCertificateSecretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(ClusterOperator.secretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    // Mock Kafka broker pods
    Pod pod0 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 0).endMetadata().withNewStatus().withHostIP("10.0.0.1").endStatus().build();
    Pod pod1 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 1).endMetadata().withNewStatus().withHostIP("10.0.0.25").endStatus().build();
    Pod pod2 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 2).endMetadata().withNewStatus().withHostIP("10.0.0.13").endStatus().build();
    List<Pod> pods = new ArrayList<>();
    pods.add(pod0);
    pods.add(pod1);
    pods.add(pod2);
    PodOperator mockPodOps = supplier.podOperations;
    when(mockPodOps.listAsync(eq(NAMESPACE), any(Labels.class))).thenReturn(Future.succeededFuture(pods));
    // Mock Kubernetes worker nodes
    NodeOperator mockNodeOps = supplier.nodeOperator;
    when(mockNodeOps.listAsync(any(Labels.class))).thenReturn(Future.succeededFuture(kubernetesWorkerNodes()));
    // Run the test
    KafkaReconciler reconciler = new MockKafkaReconcilerStatusTasks(new Reconciliation("test-trigger", Kafka.RESOURCE_KIND, NAMESPACE, CLUSTER_NAME), supplier, kafka);
    KafkaStatus status = new KafkaStatus();
    Checkpoint async = context.checkpoint();
    reconciler.reconcile(status, Date::new).onComplete(res -> context.verify(() -> {
        assertThat(res.succeeded(), is(true));
        // Check listener status
        assertThat(status.getListeners().size(), is(1));
        assertThat(status.getListeners().get(0).getName(), is("external"));
        assertThat(status.getListeners().get(0).getType(), is("external"));
        assertThat(status.getListeners().get(0).getBootstrapServers(), is("node-0.my-kube:31234,node-1.my-kube:31234,node-3.my-kube:31234"));
        assertThat(status.getListeners().get(0).getAddresses().size(), is(3));
        assertThat(status.getListeners().get(0).getAddresses().get(0).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(0).getHost(), is("node-0.my-kube"));
        assertThat(status.getListeners().get(0).getAddresses().get(1).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(1).getHost(), is("node-1.my-kube"));
        assertThat(status.getListeners().get(0).getAddresses().get(2).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(2).getHost(), is("node-3.my-kube"));
        async.flag();
    }));
}
Also used : Pod(io.fabric8.kubernetes.api.model.Pod) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) ArrayList(java.util.ArrayList) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) Labels(io.strimzi.operator.common.model.Labels) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) Checkpoint(io.vertx.junit5.Checkpoint) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) NodeOperator(io.strimzi.operator.common.operator.resource.NodeOperator) KafkaStatus(io.strimzi.api.kafka.model.status.KafkaStatus) Test(org.junit.jupiter.api.Test)

Example 73 with PodOperator

use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.

the class KafkaReconcilerStatusTest method testKafkaReconcilerStatusWithNodePorts.

@Test
public void testKafkaReconcilerStatusWithNodePorts(VertxTestContext context) {
    Kafka kafka = new KafkaBuilder(KAFKA).editOrNewSpec().editOrNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.NODEPORT).withTls(true).build()).endKafka().endSpec().build();
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    // Mock the secrets needed for Kafka client
    SecretOperator mockSecretOps = supplier.secretOperations;
    Secret secret = new Secret();
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(KafkaResources.clusterCaCertificateSecretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(ClusterOperator.secretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    // Mock Kafka broker pods
    Pod pod0 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 0).endMetadata().withNewStatus().withHostIP("10.0.0.1").endStatus().build();
    Pod pod1 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 1).endMetadata().withNewStatus().withHostIP("10.0.0.25").endStatus().build();
    Pod pod2 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 2).endMetadata().withNewStatus().withHostIP("10.0.0.13").endStatus().build();
    List<Pod> pods = new ArrayList<>();
    pods.add(pod0);
    pods.add(pod1);
    pods.add(pod2);
    PodOperator mockPodOps = supplier.podOperations;
    when(mockPodOps.listAsync(eq(NAMESPACE), any(Labels.class))).thenReturn(Future.succeededFuture(pods));
    // Mock Kubernetes worker nodes
    NodeOperator mockNodeOps = supplier.nodeOperator;
    when(mockNodeOps.listAsync(any(Labels.class))).thenReturn(Future.succeededFuture(kubernetesWorkerNodes()));
    // Run the test
    KafkaReconciler reconciler = new MockKafkaReconcilerStatusTasks(new Reconciliation("test-trigger", Kafka.RESOURCE_KIND, NAMESPACE, CLUSTER_NAME), supplier, kafka);
    KafkaStatus status = new KafkaStatus();
    Checkpoint async = context.checkpoint();
    reconciler.reconcile(status, Date::new).onComplete(res -> context.verify(() -> {
        assertThat(res.succeeded(), is(true));
        // Check listener status
        assertThat(status.getListeners().size(), is(1));
        assertThat(status.getListeners().get(0).getName(), is("external"));
        assertThat(status.getListeners().get(0).getType(), is("external"));
        assertThat(status.getListeners().get(0).getBootstrapServers(), is("5.124.16.8:31234,55.36.78.115:31234,50.35.18.119:31234"));
        assertThat(status.getListeners().get(0).getAddresses().size(), is(3));
        assertThat(status.getListeners().get(0).getAddresses().get(0).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(0).getHost(), is("5.124.16.8"));
        assertThat(status.getListeners().get(0).getAddresses().get(1).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(1).getHost(), is("55.36.78.115"));
        assertThat(status.getListeners().get(0).getAddresses().get(2).getPort(), is(31234));
        assertThat(status.getListeners().get(0).getAddresses().get(2).getHost(), is("50.35.18.119"));
        async.flag();
    }));
}
Also used : Pod(io.fabric8.kubernetes.api.model.Pod) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) ArrayList(java.util.ArrayList) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) Labels(io.strimzi.operator.common.model.Labels) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) Checkpoint(io.vertx.junit5.Checkpoint) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) NodeOperator(io.strimzi.operator.common.operator.resource.NodeOperator) KafkaStatus(io.strimzi.api.kafka.model.status.KafkaStatus) Test(org.junit.jupiter.api.Test)

Example 74 with PodOperator

use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.

the class KafkaReconcilerStatusTest method testKafkaReconcilerStatusWithNodePortsAndMissingNode.

@Test
public void testKafkaReconcilerStatusWithNodePortsAndMissingNode(VertxTestContext context) {
    Kafka kafka = new KafkaBuilder(KAFKA).editOrNewSpec().editOrNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.NODEPORT).withTls(true).build()).endKafka().endSpec().build();
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    // Mock the secrets needed for Kafka client
    SecretOperator mockSecretOps = supplier.secretOperations;
    Secret secret = new Secret();
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(KafkaResources.clusterCaCertificateSecretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    when(mockSecretOps.getAsync(eq(NAMESPACE), eq(ClusterOperator.secretName(CLUSTER_NAME)))).thenReturn(Future.succeededFuture(secret));
    // Mock Kafka broker pods
    Pod pod0 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 0).endMetadata().withNewStatus().withHostIP("10.0.0.5").endStatus().build();
    Pod pod1 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 1).endMetadata().withNewStatus().withHostIP("10.0.0.5").endStatus().build();
    Pod pod2 = new PodBuilder().withNewMetadata().withName(CLUSTER_NAME + "-kafka-" + 2).endMetadata().withNewStatus().withHostIP("10.0.0.5").endStatus().build();
    List<Pod> pods = new ArrayList<>();
    pods.add(pod0);
    pods.add(pod1);
    pods.add(pod2);
    PodOperator mockPodOps = supplier.podOperations;
    when(mockPodOps.listAsync(eq(NAMESPACE), any(Labels.class))).thenReturn(Future.succeededFuture(pods));
    // Mock Kubernetes worker nodes
    NodeOperator mockNodeOps = supplier.nodeOperator;
    when(mockNodeOps.listAsync(any(Labels.class))).thenReturn(Future.succeededFuture(kubernetesWorkerNodes()));
    // Run the test
    KafkaReconciler reconciler = new MockKafkaReconcilerStatusTasks(new Reconciliation("test-trigger", Kafka.RESOURCE_KIND, NAMESPACE, CLUSTER_NAME), supplier, kafka);
    KafkaStatus status = new KafkaStatus();
    Checkpoint async = context.checkpoint();
    reconciler.reconcile(status, Date::new).onComplete(res -> context.verify(() -> {
        assertThat(res.succeeded(), is(true));
        // Check listener status
        assertThat(status.getListeners().size(), is(1));
        assertThat(status.getListeners().get(0).getName(), is("external"));
        assertThat(status.getListeners().get(0).getType(), is("external"));
        assertThat(status.getListeners().get(0).getBootstrapServers(), is(nullValue()));
        assertThat(status.getListeners().get(0).getAddresses(), is(List.of()));
        async.flag();
    }));
}
Also used : Pod(io.fabric8.kubernetes.api.model.Pod) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) ArrayList(java.util.ArrayList) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) Labels(io.strimzi.operator.common.model.Labels) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) Checkpoint(io.vertx.junit5.Checkpoint) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) NodeOperator(io.strimzi.operator.common.operator.resource.NodeOperator) KafkaStatus(io.strimzi.api.kafka.model.status.KafkaStatus) Test(org.junit.jupiter.api.Test)

Example 75 with PodOperator

use of io.strimzi.operator.common.operator.resource.PodOperator in project strimzi-kafka-operator by strimzi.

the class StrimziPodSetControllerMockTest method beforeEach.

@BeforeEach
public void beforeEach() {
    // Configure the Kubernetes Mock
    mockKube = new MockKube2.MockKube2Builder(client).withKafkaCrd().withStrimziPodSetCrd().withPodController().build();
    mockKube.start();
    vertx = Vertx.vertx();
    kafkaOperator = new CrdOperator<>(vertx, client, Kafka.class, KafkaList.class, Kafka.RESOURCE_KIND);
    podSetOperator = new StrimziPodSetOperator(vertx, client, 10_000L);
    podOperator = new PodOperator(vertx, client);
    kafkaOp().inNamespace(NAMESPACE).create(kafka(KAFKA_NAME, MATCHING_LABELS));
    kafkaOp().inNamespace(NAMESPACE).create(kafka(OTHER_KAFKA_NAME, OTHER_LABELS));
    startController();
}
Also used : StrimziPodSetOperator(io.strimzi.operator.common.operator.resource.StrimziPodSetOperator) MockKube2(io.strimzi.test.mockkube2.MockKube2) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaList(io.strimzi.api.kafka.KafkaList) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PodOperator (io.strimzi.operator.common.operator.resource.PodOperator)180 Test (org.junit.jupiter.api.Test)166 Checkpoint (io.vertx.junit5.Checkpoint)138 Reconciliation (io.strimzi.operator.common.Reconciliation)134 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)114 Future (io.vertx.core.Future)114 VertxTestContext (io.vertx.junit5.VertxTestContext)112 CoreMatchers.is (org.hamcrest.CoreMatchers.is)112 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)112 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)112 Mockito.when (org.mockito.Mockito.when)112 Vertx (io.vertx.core.Vertx)104 VertxExtension (io.vertx.junit5.VertxExtension)102 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)102 List (java.util.List)100 ArgumentMatchers.eq (org.mockito.ArgumentMatchers.eq)100 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)98 PlatformFeaturesAvailability (io.strimzi.operator.PlatformFeaturesAvailability)98 CrdOperator (io.strimzi.operator.common.operator.resource.CrdOperator)94 KafkaVersionTestUtils (io.strimzi.operator.cluster.KafkaVersionTestUtils)92