Search in sources :

Example 46 with KafkaConnect

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

the class ConnectorMockTest method testConnectorNotReadyWhenConnectNotConfiguredForConnectors.

@Test
public void testConnectorNotReadyWhenConnectNotConfiguredForConnectors() {
    String connectName = "cluster";
    String connectorName = "connector";
    KafkaConnect connect = new KafkaConnectBuilder().withNewMetadata().withNamespace(NAMESPACE).withName(connectName).endMetadata().withNewSpec().withReplicas(1).endSpec().build();
    Crds.kafkaConnectOperation(client).inNamespace(NAMESPACE).create(connect);
    waitForConnectReady(connectName);
    KafkaConnector connector = new KafkaConnectorBuilder().withNewMetadata().withName(connectorName).withNamespace(NAMESPACE).addToLabels(Labels.STRIMZI_CLUSTER_LABEL, connectName).endMetadata().withNewSpec().endSpec().build();
    Crds.kafkaConnectorOperation(client).inNamespace(NAMESPACE).create(connector);
    waitForConnectorNotReady(connectorName, "NoSuchResourceException", "KafkaConnect cluster is not configured with annotation " + Annotations.STRIMZI_IO_USE_CONNECTOR_RESOURCES);
}
Also used : KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) KafkaConnectorBuilder(io.strimzi.api.kafka.model.KafkaConnectorBuilder) KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) Test(org.junit.jupiter.api.Test)

Example 47 with KafkaConnect

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

the class ModelUtilsTest method testParseDeploymentTemplate.

@Test
public void testParseDeploymentTemplate() {
    KafkaConnect connect = new KafkaConnectBuilder().withNewMetadata().withName("my-connect-cluster").withNamespace("my-namespace").endMetadata().build();
    DeploymentTemplate template = new DeploymentTemplateBuilder().withNewMetadata().withAnnotations(Collections.singletonMap("annoKey", "annoValue")).withLabels(Collections.singletonMap("labelKey", "labelValue")).endMetadata().withDeploymentStrategy(DeploymentStrategy.RECREATE).build();
    Model model = new Model(Reconciliation.DUMMY_RECONCILIATION, connect);
    ModelUtils.parseDeploymentTemplate(model, template);
    assertThat(model.templateDeploymentLabels, is(Collections.singletonMap("labelKey", "labelValue")));
    assertThat(model.templateDeploymentAnnotations, is(Collections.singletonMap("annoKey", "annoValue")));
    assertThat(model.templateDeploymentStrategy, is(DeploymentStrategy.RECREATE));
}
Also used : KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) DeploymentTemplateBuilder(io.strimzi.api.kafka.model.template.DeploymentTemplateBuilder) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) DeploymentTemplate(io.strimzi.api.kafka.model.template.DeploymentTemplate) ParallelTest(io.strimzi.test.annotations.ParallelTest) Test(org.junit.jupiter.api.Test)

Example 48 with KafkaConnect

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

the class KafkaConnectAssemblyOperatorMockTest method setConnectResource.

private void setConnectResource(KafkaConnect connectResource) {
    mockKube = new MockKube();
    mockClient = mockKube.withCustomResourceDefinition(Crds.kafkaConnect(), KafkaConnect.class, KafkaConnectList.class, KafkaConnect::getStatus, KafkaConnect::setStatus).withInitialInstances(Collections.singleton(connectResource)).end().withCustomResourceDefinition(Crds.kafkaConnector(), KafkaConnector.class, KafkaConnectorList.class, KafkaConnector::getStatus, KafkaConnector::setStatus).end().build();
}
Also used : MockKube(io.strimzi.test.mockkube.MockKube) KafkaConnectorList(io.strimzi.api.kafka.KafkaConnectorList) KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect)

Example 49 with KafkaConnect

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

the class KafkaConnectAssemblyOperatorMockTest method testPauseReconcileUnpause.

@Test
public void testPauseReconcileUnpause(VertxTestContext context) {
    setConnectResource(new KafkaConnectBuilder().withMetadata(new ObjectMetaBuilder().withName(CLUSTER_NAME).withNamespace(NAMESPACE).withLabels(TestUtils.map("foo", "bar")).withAnnotations(singletonMap("strimzi.io/pause-reconciliation", "true")).build()).withNewSpec().withReplicas(replicas).endSpec().build());
    KafkaConnectApi mock = mock(KafkaConnectApi.class);
    when(mock.list(anyString(), anyInt())).thenReturn(Future.succeededFuture(emptyList()));
    when(mock.listConnectorPlugins(any(), anyString(), anyInt())).thenReturn(Future.succeededFuture(emptyList()));
    Checkpoint async = context.checkpoint();
    createConnectCluster(context, mock, true).onComplete(context.succeeding()).compose(v -> {
        LOGGER.info("Reconciling again -> update");
        return kco.reconcile(new Reconciliation("test-trigger", KafkaConnect.RESOURCE_KIND, NAMESPACE, CLUSTER_NAME));
    }).onComplete(context.succeeding(v -> context.verify(() -> {
        Resource<KafkaConnect> resource = Crds.kafkaConnectOperation(mockClient).inNamespace(NAMESPACE).withName(CLUSTER_NAME);
        if (resource.get().getStatus() == null) {
            fail();
        }
        List<Condition> conditions = resource.get().getStatus().getConditions();
        boolean conditionFound = false;
        if (conditions != null && !conditions.isEmpty()) {
            for (Condition condition : conditions) {
                if ("ReconciliationPaused".equals(condition.getType())) {
                    conditionFound = true;
                    break;
                }
            }
        }
        assertTrue(conditionFound);
        async.flag();
    }))).compose(v -> {
        setConnectResource(new KafkaConnectBuilder().withMetadata(new ObjectMetaBuilder().withName(CLUSTER_NAME).withNamespace(NAMESPACE).withLabels(TestUtils.map("foo", "bar")).withAnnotations(singletonMap("strimzi.io/pause-reconciliation", "false")).build()).withNewSpec().withReplicas(replicas).endSpec().build());
        LOGGER.info("Reconciling again -> update");
        return kco.reconcile(new Reconciliation("test-trigger", KafkaConnect.RESOURCE_KIND, NAMESPACE, CLUSTER_NAME));
    }).onComplete(context.succeeding(v -> context.verify(() -> {
        Resource<KafkaConnect> resource = Crds.kafkaConnectOperation(mockClient).inNamespace(NAMESPACE).withName(CLUSTER_NAME);
        if (resource.get().getStatus() == null) {
            fail();
        }
        List<Condition> conditions = resource.get().getStatus().getConditions();
        boolean conditionFound = false;
        if (conditions != null && !conditions.isEmpty()) {
            for (Condition condition : conditions) {
                if ("ReconciliationPaused".equals(condition.getType())) {
                    conditionFound = true;
                    break;
                }
            }
        }
        assertFalse(conditionFound);
        async.flag();
    })));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) KafkaConnectorList(io.strimzi.api.kafka.KafkaConnectorList) KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) MockKube(io.strimzi.test.mockkube.MockKube) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) AfterAll(org.junit.jupiter.api.AfterAll) Resource(io.fabric8.kubernetes.client.dsl.Resource) DefaultAdminClientProvider(io.strimzi.operator.common.DefaultAdminClientProvider) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BeforeAll(org.junit.jupiter.api.BeforeAll) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) ResourceUtils(io.strimzi.operator.cluster.ResourceUtils) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) Collections.emptyList(java.util.Collections.emptyList) KafkaVersion(io.strimzi.operator.cluster.model.KafkaVersion) KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Test(org.junit.jupiter.api.Test) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Checkpoint(io.vertx.junit5.Checkpoint) Condition(io.strimzi.api.kafka.model.status.Condition) KafkaConnectList(io.strimzi.api.kafka.KafkaConnectList) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) ClusterOperatorConfig(io.strimzi.operator.cluster.ClusterOperatorConfig) Mockito.mock(org.mockito.Mockito.mock) VertxTestContext(io.vertx.junit5.VertxTestContext) Assertions.fail(org.junit.jupiter.api.Assertions.fail) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BackOff(io.strimzi.operator.common.BackOff) Crds(io.strimzi.api.kafka.Crds) FeatureGates(io.strimzi.operator.cluster.FeatureGates) KafkaVersionTestUtils(io.strimzi.operator.cluster.KafkaVersionTestUtils) ZookeeperLeaderFinder(io.strimzi.operator.cluster.operator.resource.ZookeeperLeaderFinder) TestUtils(io.strimzi.test.TestUtils) Collections.singletonMap(java.util.Collections.singletonMap) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder) Promise(io.vertx.core.Promise) KubernetesVersion(io.strimzi.operator.KubernetesVersion) Vertx(io.vertx.core.Vertx) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) Reconciliation(io.strimzi.operator.common.Reconciliation) AfterEach(org.junit.jupiter.api.AfterEach) Mockito.never(org.mockito.Mockito.never) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) DefaultZookeeperScalerProvider(io.strimzi.operator.cluster.operator.resource.DefaultZookeeperScalerProvider) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) KafkaConnectResources(io.strimzi.api.kafka.model.KafkaConnectResources) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Condition(io.strimzi.api.kafka.model.status.Condition) KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) Checkpoint(io.vertx.junit5.Checkpoint) Reconciliation(io.strimzi.operator.common.Reconciliation) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder) Test(org.junit.jupiter.api.Test)

Example 50 with KafkaConnect

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

the class KafkaConnectBuildAssemblyOperatorKubeTest method testContinueWithPreviousBuildOnKube.

@SuppressWarnings({ "checkstyle:MethodLength" })
@Test
public void testContinueWithPreviousBuildOnKube(VertxTestContext context) {
    Plugin plugin1 = new PluginBuilder().withName("plugin1").withArtifacts(new JarArtifactBuilder().withUrl("https://my-domain.tld/my.jar").build()).build();
    Plugin plugin2 = new PluginBuilder().withName("plugin2").withArtifacts(new JarArtifactBuilder().withUrl("https://my-domain.tld/my2.jar").build()).build();
    KafkaConnect oldKc = new KafkaConnectBuilder().withNewMetadata().withName(NAME).withNamespace(NAMESPACE).endMetadata().withNewSpec().withReplicas(1).withBootstrapServers("my-cluster-kafka-bootstrap:9092").withNewBuild().withNewDockerOutput().withImage(OUTPUT_IMAGE).withPushSecret("my-docker-credentials").endDockerOutput().withPlugins(plugin1, plugin2).endBuild().endSpec().build();
    KafkaConnectCluster oldConnect = KafkaConnectCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, oldKc, VERSIONS);
    KafkaConnectBuild oldBuild = KafkaConnectBuild.fromCrd(Reconciliation.DUMMY_RECONCILIATION, oldKc, VERSIONS);
    KafkaConnect kc = new KafkaConnectBuilder(oldKc).editSpec().editBuild().withPlugins(plugin1, plugin2).endBuild().endSpec().build();
    KafkaConnectBuild build = KafkaConnectBuild.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kc, VERSIONS);
    // Prepare and get mocks
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(true);
    CrdOperator mockConnectOps = supplier.connectOperator;
    DeploymentOperator mockDepOps = supplier.deploymentOperations;
    PodDisruptionBudgetOperator mockPdbOps = supplier.podDisruptionBudgetOperator;
    PodDisruptionBudgetV1Beta1Operator mockPdbOpsV1Beta1 = supplier.podDisruptionBudgetV1Beta1Operator;
    ConfigMapOperator mockCmOps = supplier.configMapOperations;
    ServiceOperator mockServiceOps = supplier.serviceOperations;
    NetworkPolicyOperator mockNetPolOps = supplier.networkPolicyOperator;
    PodOperator mockPodOps = supplier.podOperations;
    BuildConfigOperator mockBcOps = supplier.buildConfigOperations;
    SecretOperator mockSecretOps = supplier.secretOperations;
    CrdOperator<KubernetesClient, KafkaConnector, KafkaConnectorList> mockConnectorOps = supplier.kafkaConnectorOperator;
    // Mock KafkaConnector ops
    when(mockConnectorOps.listAsync(anyString(), any(Optional.class))).thenReturn(Future.succeededFuture(emptyList()));
    // Mock KafkaConnect ops
    when(mockConnectOps.get(NAMESPACE, NAME)).thenReturn(kc);
    when(mockConnectOps.getAsync(anyString(), anyString())).thenReturn(Future.succeededFuture(kc));
    // Mock and capture service ops
    ArgumentCaptor<Service> serviceCaptor = ArgumentCaptor.forClass(Service.class);
    when(mockServiceOps.reconcile(any(), anyString(), anyString(), serviceCaptor.capture())).thenReturn(Future.succeededFuture());
    // Mock and capture deployment ops
    ArgumentCaptor<Deployment> depCaptor = ArgumentCaptor.forClass(Deployment.class);
    when(mockDepOps.reconcile(any(), anyString(), anyString(), depCaptor.capture())).thenReturn(Future.succeededFuture());
    when(mockDepOps.getAsync(eq(NAMESPACE), eq(KafkaConnectResources.deploymentName(NAME)))).thenAnswer(inv -> {
        Deployment dep = oldConnect.generateDeployment(emptyMap(), false, null, null);
        dep.getSpec().getTemplate().getMetadata().getAnnotations().put(Annotations.STRIMZI_IO_CONNECT_BUILD_REVISION, "oldhashstub");
        dep.getSpec().getTemplate().getSpec().getContainers().get(0).setImage("my-connect-build@sha256:olddigest");
        return Future.succeededFuture(dep);
    });
    when(mockDepOps.scaleUp(any(), anyString(), anyString(), anyInt())).thenReturn(Future.succeededFuture(42));
    when(mockDepOps.scaleDown(any(), anyString(), anyString(), anyInt())).thenReturn(Future.succeededFuture(42));
    when(mockDepOps.readiness(any(), anyString(), anyString(), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    when(mockDepOps.waitForObserved(any(), anyString(), anyString(), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    when(mockSecretOps.reconcile(any(), anyString(), anyString(), any())).thenReturn(Future.succeededFuture());
    // Mock and capture CM ops
    when(mockCmOps.reconcile(any(), anyString(), any(), any())).thenReturn(Future.succeededFuture(ReconcileResult.created(new ConfigMap())));
    ArgumentCaptor<ConfigMap> dockerfileCaptor = ArgumentCaptor.forClass(ConfigMap.class);
    when(mockCmOps.reconcile(any(), anyString(), eq(KafkaConnectResources.dockerFileConfigMapName(NAME)), dockerfileCaptor.capture())).thenReturn(Future.succeededFuture(ReconcileResult.created(new ConfigMap())));
    // Mock and capture Pod ops
    ArgumentCaptor<Pod> builderPodCaptor = ArgumentCaptor.forClass(Pod.class);
    when(mockPodOps.reconcile(any(), eq(NAMESPACE), eq(KafkaConnectResources.buildPodName(NAME)), builderPodCaptor.capture())).thenReturn(Future.succeededFuture(ReconcileResult.noop(null)));
    Pod runningBuild = new PodBuilder().withNewMetadata().withName(KafkaConnectResources.buildPodName(NAME)).withNamespace(NAMESPACE).withAnnotations(singletonMap(Annotations.STRIMZI_IO_CONNECT_BUILD_REVISION, oldBuild.generateDockerfile().hashStub() + OUTPUT_IMAGE_HASH_STUB)).endMetadata().withNewSpec().endSpec().build();
    Pod terminatedPod = new PodBuilder().withNewMetadata().withName(KafkaConnectResources.buildPodName(NAME)).withNamespace(NAMESPACE).withAnnotations(singletonMap(Annotations.STRIMZI_IO_CONNECT_BUILD_REVISION, oldBuild.generateDockerfile().hashStub())).endMetadata().withNewSpec().endSpec().withNewStatus().withContainerStatuses(new ContainerStatusBuilder().withNewState().withNewTerminated().withExitCode(0).withMessage("my-connect-build@sha256:blablabla").endTerminated().endState().build()).endStatus().build();
    when(mockPodOps.waitFor(any(), eq(NAMESPACE), eq(KafkaConnectResources.buildPodName(NAME)), anyString(), anyLong(), anyLong(), any(BiPredicate.class))).thenReturn(Future.succeededFuture((Void) null));
    when(mockPodOps.getAsync(eq(NAMESPACE), eq(KafkaConnectResources.buildPodName(NAME)))).thenReturn(Future.succeededFuture(runningBuild), Future.succeededFuture(terminatedPod));
    // Mock and capture BuildConfig ops
    when(mockBcOps.reconcile(any(), eq(NAMESPACE), eq(KafkaConnectResources.buildConfigName(NAME)), eq(null))).thenReturn(Future.succeededFuture(ReconcileResult.noop(null)));
    // Mock and capture NP ops
    when(mockNetPolOps.reconcile(any(), eq(NAMESPACE), eq(KafkaConnectResources.deploymentName(NAME)), any())).thenReturn(Future.succeededFuture(ReconcileResult.created(new NetworkPolicy())));
    // Mock and capture PDB ops
    when(mockPdbOps.reconcile(any(), anyString(), any(), any())).thenReturn(Future.succeededFuture());
    when(mockPdbOpsV1Beta1.reconcile(any(), anyString(), any(), any())).thenReturn(Future.succeededFuture());
    // Mock and capture KafkaConnect ops for status update
    ArgumentCaptor<KafkaConnect> connectCaptor = ArgumentCaptor.forClass(KafkaConnect.class);
    when(mockConnectOps.updateStatusAsync(any(), connectCaptor.capture())).thenReturn(Future.succeededFuture());
    // Mock KafkaConnect API client
    KafkaConnectApi mockConnectClient = mock(KafkaConnectApi.class);
    // Prepare and run reconciliation
    KafkaConnectAssemblyOperator ops = new KafkaConnectAssemblyOperator(vertx, new PlatformFeaturesAvailability(false, kubernetesVersion), supplier, ResourceUtils.dummyClusterOperatorConfig(VERSIONS), x -> mockConnectClient);
    KafkaConnectCluster connect = KafkaConnectCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kc, VERSIONS);
    Checkpoint async = context.checkpoint();
    ops.reconcile(new Reconciliation("test-trigger", KafkaConnect.RESOURCE_KIND, NAMESPACE, NAME)).onComplete(context.succeeding(v -> context.verify(() -> {
        // Verify Deployment
        List<Deployment> capturedDeps = depCaptor.getAllValues();
        assertThat(capturedDeps, hasSize(1));
        Deployment dep = capturedDeps.get(0);
        assertThat(dep.getMetadata().getName(), is(connect.getName()));
        assertThat(dep.getSpec().getTemplate().getSpec().getContainers().get(0).getImage(), is("my-connect-build@sha256:blablabla"));
        assertThat(Annotations.stringAnnotation(dep.getSpec().getTemplate(), Annotations.STRIMZI_IO_CONNECT_BUILD_REVISION, null), is(build.generateDockerfile().hashStub() + OUTPUT_IMAGE_HASH_STUB));
        // Verify ConfigMap
        List<ConfigMap> capturedCms = dockerfileCaptor.getAllValues();
        assertThat(capturedCms, hasSize(0));
        // Verify builder Pod
        List<Pod> capturedBuilderPods = builderPodCaptor.getAllValues();
        assertThat(capturedBuilderPods, hasSize(1));
        assertThat(capturedBuilderPods.stream().filter(pod -> pod != null).collect(Collectors.toList()), hasSize(0));
        // Verify status
        List<KafkaConnect> capturedConnects = connectCaptor.getAllValues();
        assertThat(capturedConnects, hasSize(1));
        KafkaConnectStatus connectStatus = capturedConnects.get(0).getStatus();
        assertThat(connectStatus.getConditions().get(0).getStatus(), is("True"));
        assertThat(connectStatus.getConditions().get(0).getType(), is("Ready"));
        async.flag();
    })));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) KafkaConnectorList(io.strimzi.api.kafka.KafkaConnectorList) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Annotations(io.strimzi.operator.common.Annotations) KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) AfterAll(org.junit.jupiter.api.AfterAll) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) PodDisruptionBudgetV1Beta1Operator(io.strimzi.operator.common.operator.resource.PodDisruptionBudgetV1Beta1Operator) BeforeAll(org.junit.jupiter.api.BeforeAll) KafkaConnectStatus(io.strimzi.api.kafka.model.status.KafkaConnectStatus) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) ResourceUtils(io.strimzi.operator.cluster.ResourceUtils) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) Collections.emptyList(java.util.Collections.emptyList) KafkaConnectBuild(io.strimzi.operator.cluster.model.KafkaConnectBuild) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) KafkaVersion(io.strimzi.operator.cluster.model.KafkaVersion) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Collectors(java.util.stream.Collectors) Test(org.junit.jupiter.api.Test) KafkaConnectCluster(io.strimzi.operator.cluster.model.KafkaConnectCluster) List(java.util.List) Plugin(io.strimzi.api.kafka.model.connect.build.Plugin) Optional(java.util.Optional) Checkpoint(io.vertx.junit5.Checkpoint) PodDisruptionBudgetOperator(io.strimzi.operator.common.operator.resource.PodDisruptionBudgetOperator) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) Mockito.mock(org.mockito.Mockito.mock) VertxTestContext(io.vertx.junit5.VertxTestContext) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) BiPredicate(java.util.function.BiPredicate) ArgumentCaptor(org.mockito.ArgumentCaptor) ServiceAccountOperator(io.strimzi.operator.common.operator.resource.ServiceAccountOperator) KafkaVersionTestUtils(io.strimzi.operator.cluster.KafkaVersionTestUtils) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) BuildConfigOperator(io.strimzi.operator.common.operator.resource.BuildConfigOperator) Matchers.hasSize(org.hamcrest.Matchers.hasSize) ReconcileResult(io.strimzi.operator.common.operator.resource.ReconcileResult) Collections.singletonMap(java.util.Collections.singletonMap) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Collections.emptyMap(java.util.Collections.emptyMap) ContainerStatusBuilder(io.fabric8.kubernetes.api.model.ContainerStatusBuilder) KubernetesVersion(io.strimzi.operator.KubernetesVersion) Vertx(io.vertx.core.Vertx) Pod(io.fabric8.kubernetes.api.model.Pod) Mockito.when(org.mockito.Mockito.when) JarArtifactBuilder(io.strimzi.api.kafka.model.connect.build.JarArtifactBuilder) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) Reconciliation(io.strimzi.operator.common.Reconciliation) Util(io.strimzi.operator.common.Util) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) ServiceAccount(io.fabric8.kubernetes.api.model.ServiceAccount) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) KafkaConnectResources(io.strimzi.api.kafka.model.KafkaConnectResources) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) KafkaConnectCluster(io.strimzi.operator.cluster.model.KafkaConnectCluster) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) JarArtifactBuilder(io.strimzi.api.kafka.model.connect.build.JarArtifactBuilder) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) KafkaConnectBuild(io.strimzi.operator.cluster.model.KafkaConnectBuild) PodDisruptionBudgetV1Beta1Operator(io.strimzi.operator.common.operator.resource.PodDisruptionBudgetV1Beta1Operator) KafkaConnectStatus(io.strimzi.api.kafka.model.status.KafkaConnectStatus) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Optional(java.util.Optional) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) Pod(io.fabric8.kubernetes.api.model.Pod) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) PodDisruptionBudgetOperator(io.strimzi.operator.common.operator.resource.PodDisruptionBudgetOperator) Service(io.fabric8.kubernetes.api.model.Service) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) ContainerStatusBuilder(io.fabric8.kubernetes.api.model.ContainerStatusBuilder) KafkaConnectorList(io.strimzi.api.kafka.KafkaConnectorList) Checkpoint(io.vertx.junit5.Checkpoint) BuildConfigOperator(io.strimzi.operator.common.operator.resource.BuildConfigOperator) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) BiPredicate(java.util.function.BiPredicate) Plugin(io.strimzi.api.kafka.model.connect.build.Plugin) Test(org.junit.jupiter.api.Test)

Aggregations

KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)266 KafkaConnectBuilder (io.strimzi.api.kafka.model.KafkaConnectBuilder)200 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)134 ParallelTest (io.strimzi.test.annotations.ParallelTest)132 Reconciliation (io.strimzi.operator.common.Reconciliation)128 List (java.util.List)113 KafkaConnectResources (io.strimzi.api.kafka.model.KafkaConnectResources)112 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)112 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)110 Service (io.fabric8.kubernetes.api.model.Service)103 NetworkPolicy (io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy)103 KafkaConnector (io.strimzi.api.kafka.model.KafkaConnector)103 KafkaVersionTestUtils (io.strimzi.operator.cluster.KafkaVersionTestUtils)98 ResourceUtils (io.strimzi.operator.cluster.ResourceUtils)98 CoreMatchers.is (org.hamcrest.CoreMatchers.is)98 Collections.emptyList (java.util.Collections.emptyList)94 Test (org.junit.jupiter.api.Test)94 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)90 HashMap (java.util.HashMap)83 Map (java.util.Map)83