Search in sources :

Example 6 with OpenSslCertManager

use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.

the class Main method run.

static Future<String> run(Vertx vertx, KubernetesClient client, AdminClientProvider adminClientProvider, UserOperatorConfig config) {
    Util.printEnvInfo();
    String dnsCacheTtl = System.getenv("STRIMZI_DNS_CACHE_TTL") == null ? "30" : System.getenv("STRIMZI_DNS_CACHE_TTL");
    Security.setProperty("networkaddress.cache.ttl", dnsCacheTtl);
    OpenSslCertManager certManager = new OpenSslCertManager();
    SecretOperator secretOperations = new SecretOperator(vertx, client);
    CrdOperator<KubernetesClient, KafkaUser, KafkaUserList> crdOperations = new CrdOperator<>(vertx, client, KafkaUser.class, KafkaUserList.class, KafkaUser.RESOURCE_KIND);
    return createAdminClient(adminClientProvider, config, secretOperations).compose(adminClient -> {
        SimpleAclOperator aclOperations = new SimpleAclOperator(vertx, adminClient);
        ScramCredentialsOperator scramCredentialsOperator = new ScramCredentialsOperator(vertx, adminClient);
        QuotasOperator quotasOperator = new QuotasOperator(vertx, adminClient);
        KafkaUserOperator kafkaUserOperations = new KafkaUserOperator(vertx, certManager, crdOperations, secretOperations, scramCredentialsOperator, quotasOperator, aclOperations, config);
        Promise<String> promise = Promise.promise();
        UserOperator operator = new UserOperator(config.getNamespace(), config, client, kafkaUserOperations);
        vertx.deployVerticle(operator, res -> {
            if (res.succeeded()) {
                LOGGER.info("User Operator verticle started in namespace {}", config.getNamespace());
            } else {
                LOGGER.error("User Operator verticle in namespace {} failed to start", config.getNamespace(), res.cause());
                System.exit(1);
            }
            promise.handle(res);
        });
        return promise.future();
    });
}
Also used : KafkaUserOperator(io.strimzi.operator.user.operator.KafkaUserOperator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) KafkaUserOperator(io.strimzi.operator.user.operator.KafkaUserOperator) KafkaUserList(io.strimzi.api.kafka.KafkaUserList) SimpleAclOperator(io.strimzi.operator.user.operator.SimpleAclOperator) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) QuotasOperator(io.strimzi.operator.user.operator.QuotasOperator) ScramCredentialsOperator(io.strimzi.operator.user.operator.ScramCredentialsOperator) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) KafkaUser(io.strimzi.api.kafka.model.KafkaUser)

Example 7 with OpenSslCertManager

use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.

the class Main method run.

static CompositeFuture run(Vertx vertx, KubernetesClient client, PlatformFeaturesAvailability pfa, ClusterOperatorConfig config) {
    Util.printEnvInfo();
    ResourceOperatorSupplier resourceOperatorSupplier = new ResourceOperatorSupplier(vertx, client, pfa, config.getOperationTimeoutMs());
    KafkaAssemblyOperator kafkaClusterOperations = null;
    KafkaConnectAssemblyOperator kafkaConnectClusterOperations = null;
    KafkaMirrorMaker2AssemblyOperator kafkaMirrorMaker2AssemblyOperator = null;
    KafkaMirrorMakerAssemblyOperator kafkaMirrorMakerAssemblyOperator = null;
    KafkaBridgeAssemblyOperator kafkaBridgeAssemblyOperator = null;
    KafkaRebalanceAssemblyOperator kafkaRebalanceAssemblyOperator = null;
    if (!config.isPodSetReconciliationOnly()) {
        OpenSslCertManager certManager = new OpenSslCertManager();
        PasswordGenerator passwordGenerator = new PasswordGenerator(12, "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789");
        kafkaClusterOperations = new KafkaAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
        kafkaConnectClusterOperations = new KafkaConnectAssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
        kafkaMirrorMaker2AssemblyOperator = new KafkaMirrorMaker2AssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
        kafkaMirrorMakerAssemblyOperator = new KafkaMirrorMakerAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
        kafkaBridgeAssemblyOperator = new KafkaBridgeAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
        kafkaRebalanceAssemblyOperator = new KafkaRebalanceAssemblyOperator(vertx, resourceOperatorSupplier, config);
    }
    @SuppressWarnings({ "rawtypes" }) List<Future> futures = new ArrayList<>(config.getNamespaces().size());
    for (String namespace : config.getNamespaces()) {
        Promise<String> prom = Promise.promise();
        futures.add(prom.future());
        ClusterOperator operator = new ClusterOperator(namespace, config, client, kafkaClusterOperations, kafkaConnectClusterOperations, kafkaMirrorMakerAssemblyOperator, kafkaMirrorMaker2AssemblyOperator, kafkaBridgeAssemblyOperator, kafkaRebalanceAssemblyOperator, resourceOperatorSupplier);
        vertx.deployVerticle(operator, res -> {
            if (res.succeeded()) {
                if (config.getCustomResourceSelector() != null) {
                    LOGGER.info("Cluster Operator verticle started in namespace {} with label selector {}", namespace, config.getCustomResourceSelector());
                } else {
                    LOGGER.info("Cluster Operator verticle started in namespace {} without label selector", namespace);
                }
            } else {
                LOGGER.error("Cluster Operator verticle in namespace {} failed to start", namespace, res.cause());
                System.exit(1);
            }
            prom.handle(res);
        });
    }
    return CompositeFuture.join(futures);
}
Also used : KafkaAssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator) KafkaBridgeAssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaBridgeAssemblyOperator) KafkaMirrorMaker2AssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaMirrorMaker2AssemblyOperator) ArrayList(java.util.ArrayList) KafkaConnectAssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaConnectAssemblyOperator) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) CompositeFuture(io.vertx.core.CompositeFuture) Future(io.vertx.core.Future) KafkaMirrorMakerAssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaMirrorMakerAssemblyOperator) KafkaRebalanceAssemblyOperator(io.strimzi.operator.cluster.operator.assembly.KafkaRebalanceAssemblyOperator)

Example 8 with OpenSslCertManager

use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.

the class KafkaClusterTest method generateBrokerSecret.

private Secret generateBrokerSecret(Set<String> externalBootstrapAddress, Map<Integer, Set<String>> externalAddresses) {
    ClusterCa clusterCa = new ClusterCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), cluster, null, null);
    clusterCa.createRenewOrReplace(namespace, cluster, emptyMap(), emptyMap(), emptyMap(), null, true);
    ClientsCa clientsCa = new ClientsCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), null, null, null, null, 365, 30, true, CertificateExpirationPolicy.RENEW_CERTIFICATE);
    clientsCa.createRenewOrReplace(namespace, cluster, emptyMap(), emptyMap(), emptyMap(), null, true);
    return kc.generateCertificatesSecret(clusterCa, clientsCa, externalBootstrapAddress, externalAddresses, true);
}
Also used : OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator)

Example 9 with OpenSslCertManager

use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.

the class CruiseControlReconcilerTest method reconcileEnabledCruiseControl.

@Test
public void reconcileEnabledCruiseControl(VertxTestContext context) {
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    DeploymentOperator mockDepOps = supplier.deploymentOperations;
    SecretOperator mockSecretOps = supplier.secretOperations;
    ServiceAccountOperator mockSaOps = supplier.serviceAccountOperations;
    ServiceOperator mockServiceOps = supplier.serviceOperations;
    NetworkPolicyOperator mockNetPolicyOps = supplier.networkPolicyOperator;
    ConfigMapOperator mockCmOps = supplier.configMapOperations;
    ArgumentCaptor<ServiceAccount> saCaptor = ArgumentCaptor.forClass(ServiceAccount.class);
    when(mockSaOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.serviceAccountName(NAME)), saCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Secret> secretCaptor = ArgumentCaptor.forClass(Secret.class);
    when(mockSecretOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.secretName(NAME)), secretCaptor.capture())).thenReturn(Future.succeededFuture());
    when(mockSecretOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.apiSecretName(NAME)), secretCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Service> serviceCaptor = ArgumentCaptor.forClass(Service.class);
    when(mockServiceOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.serviceName(NAME)), serviceCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<NetworkPolicy> netPolicyCaptor = ArgumentCaptor.forClass(NetworkPolicy.class);
    when(mockNetPolicyOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.networkPolicyName(NAME)), netPolicyCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<ConfigMap> cmCaptor = ArgumentCaptor.forClass(ConfigMap.class);
    when(mockCmOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.logAndMetricsConfigMapName(NAME)), cmCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Deployment> depCaptor = ArgumentCaptor.forClass(Deployment.class);
    when(mockDepOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), depCaptor.capture())).thenReturn(Future.succeededFuture());
    when(mockDepOps.waitForObserved(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    when(mockDepOps.readiness(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    Kafka kafka = new KafkaBuilder(ResourceUtils.createKafka(NAMESPACE, NAME, 3, "foo", 120, 30)).editSpec().withCruiseControl(cruiseControlSpec).endSpec().build();
    ClusterCa clusterCa = new ClusterCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), NAME, ResourceUtils.createInitialCaCertSecret(NAMESPACE, NAME, AbstractModel.clusterCaCertSecretName(NAME), MockCertManager.clusterCaCert(), MockCertManager.clusterCaCertStore(), "123456"), ResourceUtils.createInitialCaKeySecret(NAMESPACE, NAME, AbstractModel.clusterCaKeySecretName(NAME), MockCertManager.clusterCaKey()));
    CruiseControlReconciler rcnclr = new CruiseControlReconciler(Reconciliation.DUMMY_RECONCILIATION, ResourceUtils.dummyClusterOperatorConfig(), supplier, kafka, VERSIONS, kafka.getSpec().getKafka().getStorage(), clusterCa);
    Checkpoint async = context.checkpoint();
    rcnclr.reconcile(false, null, null, Date::new).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(saCaptor.getAllValues().size(), is(1));
        assertThat(saCaptor.getValue(), is(notNullValue()));
        assertThat(secretCaptor.getAllValues().size(), is(2));
        assertThat(secretCaptor.getAllValues().get(0), is(notNullValue()));
        assertThat(secretCaptor.getAllValues().get(1), is(notNullValue()));
        assertThat(serviceCaptor.getAllValues().size(), is(1));
        assertThat(serviceCaptor.getValue(), is(notNullValue()));
        assertThat(netPolicyCaptor.getAllValues().size(), is(1));
        assertThat(netPolicyCaptor.getValue(), is(notNullValue()));
        assertThat(cmCaptor.getAllValues().size(), is(1));
        assertThat(cmCaptor.getValue(), is(notNullValue()));
        assertThat(depCaptor.getAllValues().size(), is(1));
        assertThat(depCaptor.getValue(), is(notNullValue()));
        async.flag();
    })));
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BrokerCapacityBuilder(io.strimzi.api.kafka.model.balancing.BrokerCapacityBuilder) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) CruiseControlSpecBuilder(io.strimzi.api.kafka.model.CruiseControlSpecBuilder) Date(java.util.Date) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) ArgumentCaptor(org.mockito.ArgumentCaptor) ServiceAccountOperator(io.strimzi.operator.common.operator.resource.ServiceAccountOperator) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) KafkaVersionTestUtils(io.strimzi.operator.cluster.KafkaVersionTestUtils) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) Map(java.util.Map) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) Service(io.fabric8.kubernetes.api.model.Service) ResourceUtils(io.strimzi.operator.cluster.ResourceUtils) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AbstractModel(io.strimzi.operator.cluster.model.AbstractModel) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) KafkaVersion(io.strimzi.operator.cluster.model.KafkaVersion) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Mockito.when(org.mockito.Mockito.when) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) CruiseControlResources(io.strimzi.api.kafka.model.CruiseControlResources) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) Secret(io.fabric8.kubernetes.api.model.Secret) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) CruiseControlSpec(io.strimzi.api.kafka.model.CruiseControlSpec) Checkpoint(io.vertx.junit5.Checkpoint) ServiceAccount(io.fabric8.kubernetes.api.model.ServiceAccount) Kafka(io.strimzi.api.kafka.model.Kafka) ClusterCa(io.strimzi.operator.cluster.model.ClusterCa) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) MockCertManager(io.strimzi.operator.common.operator.MockCertManager) ServiceAccount(io.fabric8.kubernetes.api.model.ServiceAccount) Kafka(io.strimzi.api.kafka.model.Kafka) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) ClusterCa(io.strimzi.operator.cluster.model.ClusterCa) Service(io.fabric8.kubernetes.api.model.Service) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) Checkpoint(io.vertx.junit5.Checkpoint) ServiceAccountOperator(io.strimzi.operator.common.operator.resource.ServiceAccountOperator) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) Test(org.junit.jupiter.api.Test)

Example 10 with OpenSslCertManager

use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.

the class CruiseControlReconcilerTest method reconcileDisabledCruiseControl.

@Test
public void reconcileDisabledCruiseControl(VertxTestContext context) {
    ResourceOperatorSupplier supplier = ResourceUtils.supplierWithMocks(false);
    DeploymentOperator mockDepOps = supplier.deploymentOperations;
    SecretOperator mockSecretOps = supplier.secretOperations;
    ServiceAccountOperator mockSaOps = supplier.serviceAccountOperations;
    ServiceOperator mockServiceOps = supplier.serviceOperations;
    NetworkPolicyOperator mockNetPolicyOps = supplier.networkPolicyOperator;
    ConfigMapOperator mockCmOps = supplier.configMapOperations;
    ArgumentCaptor<ServiceAccount> saCaptor = ArgumentCaptor.forClass(ServiceAccount.class);
    when(mockSaOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.serviceAccountName(NAME)), saCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Secret> secretCaptor = ArgumentCaptor.forClass(Secret.class);
    when(mockSecretOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.secretName(NAME)), secretCaptor.capture())).thenReturn(Future.succeededFuture());
    when(mockSecretOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.apiSecretName(NAME)), secretCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Service> serviceCaptor = ArgumentCaptor.forClass(Service.class);
    when(mockServiceOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.serviceName(NAME)), serviceCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<NetworkPolicy> netPolicyCaptor = ArgumentCaptor.forClass(NetworkPolicy.class);
    when(mockNetPolicyOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.networkPolicyName(NAME)), netPolicyCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<ConfigMap> cmCaptor = ArgumentCaptor.forClass(ConfigMap.class);
    when(mockCmOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.logAndMetricsConfigMapName(NAME)), cmCaptor.capture())).thenReturn(Future.succeededFuture());
    ArgumentCaptor<Deployment> depCaptor = ArgumentCaptor.forClass(Deployment.class);
    when(mockDepOps.reconcile(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), depCaptor.capture())).thenReturn(Future.succeededFuture());
    when(mockDepOps.waitForObserved(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    when(mockDepOps.readiness(any(), eq(NAMESPACE), eq(CruiseControlResources.deploymentName(NAME)), anyLong(), anyLong())).thenReturn(Future.succeededFuture());
    Kafka kafka = ResourceUtils.createKafka(NAMESPACE, NAME, 3, "foo", 120, 30);
    ClusterCa clusterCa = new ClusterCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), NAME, ResourceUtils.createInitialCaCertSecret(NAMESPACE, NAME, AbstractModel.clusterCaCertSecretName(NAME), MockCertManager.clusterCaCert(), MockCertManager.clusterCaCertStore(), "123456"), ResourceUtils.createInitialCaKeySecret(NAMESPACE, NAME, AbstractModel.clusterCaKeySecretName(NAME), MockCertManager.clusterCaKey()));
    CruiseControlReconciler rcnclr = new CruiseControlReconciler(Reconciliation.DUMMY_RECONCILIATION, ResourceUtils.dummyClusterOperatorConfig(), supplier, kafka, VERSIONS, kafka.getSpec().getKafka().getStorage(), clusterCa);
    Checkpoint async = context.checkpoint();
    rcnclr.reconcile(false, null, null, Date::new).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(saCaptor.getAllValues().size(), is(1));
        assertThat(saCaptor.getValue(), is(nullValue()));
        assertThat(secretCaptor.getAllValues().size(), is(2));
        assertThat(secretCaptor.getAllValues().get(0), is(nullValue()));
        assertThat(secretCaptor.getAllValues().get(1), is(nullValue()));
        assertThat(serviceCaptor.getAllValues().size(), is(1));
        assertThat(serviceCaptor.getValue(), is(nullValue()));
        assertThat(netPolicyCaptor.getAllValues().size(), is(1));
        assertThat(netPolicyCaptor.getValue(), is(nullValue()));
        assertThat(cmCaptor.getAllValues().size(), is(1));
        assertThat(cmCaptor.getValue(), is(nullValue()));
        assertThat(depCaptor.getAllValues().size(), is(1));
        assertThat(depCaptor.getValue(), is(nullValue()));
        async.flag();
    })));
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BrokerCapacityBuilder(io.strimzi.api.kafka.model.balancing.BrokerCapacityBuilder) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) CruiseControlSpecBuilder(io.strimzi.api.kafka.model.CruiseControlSpecBuilder) Date(java.util.Date) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) ArgumentCaptor(org.mockito.ArgumentCaptor) ServiceAccountOperator(io.strimzi.operator.common.operator.resource.ServiceAccountOperator) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) KafkaVersionTestUtils(io.strimzi.operator.cluster.KafkaVersionTestUtils) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) Map(java.util.Map) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) Service(io.fabric8.kubernetes.api.model.Service) ResourceUtils(io.strimzi.operator.cluster.ResourceUtils) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AbstractModel(io.strimzi.operator.cluster.model.AbstractModel) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) KafkaVersion(io.strimzi.operator.cluster.model.KafkaVersion) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Mockito.when(org.mockito.Mockito.when) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) CruiseControlResources(io.strimzi.api.kafka.model.CruiseControlResources) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) Secret(io.fabric8.kubernetes.api.model.Secret) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) CruiseControlSpec(io.strimzi.api.kafka.model.CruiseControlSpec) Checkpoint(io.vertx.junit5.Checkpoint) ServiceAccount(io.fabric8.kubernetes.api.model.ServiceAccount) Kafka(io.strimzi.api.kafka.model.Kafka) ClusterCa(io.strimzi.operator.cluster.model.ClusterCa) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) MockCertManager(io.strimzi.operator.common.operator.MockCertManager) ServiceAccount(io.fabric8.kubernetes.api.model.ServiceAccount) Kafka(io.strimzi.api.kafka.model.Kafka) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) ServiceOperator(io.strimzi.operator.common.operator.resource.ServiceOperator) NetworkPolicyOperator(io.strimzi.operator.common.operator.resource.NetworkPolicyOperator) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) PasswordGenerator(io.strimzi.operator.common.PasswordGenerator) DeploymentOperator(io.strimzi.operator.common.operator.resource.DeploymentOperator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) NetworkPolicy(io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy) ClusterCa(io.strimzi.operator.cluster.model.ClusterCa) Service(io.fabric8.kubernetes.api.model.Service) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Secret(io.fabric8.kubernetes.api.model.Secret) OpenSslCertManager(io.strimzi.certs.OpenSslCertManager) Checkpoint(io.vertx.junit5.Checkpoint) ServiceAccountOperator(io.strimzi.operator.common.operator.resource.ServiceAccountOperator) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) Test(org.junit.jupiter.api.Test)

Aggregations

OpenSslCertManager (io.strimzi.certs.OpenSslCertManager)22 PasswordGenerator (io.strimzi.operator.common.PasswordGenerator)20 Secret (io.fabric8.kubernetes.api.model.Secret)10 ParallelTest (io.strimzi.test.annotations.ParallelTest)8 SecretBuilder (io.fabric8.kubernetes.api.model.SecretBuilder)6 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)6 SecretOperator (io.strimzi.operator.common.operator.resource.SecretOperator)6 Future (io.vertx.core.Future)6 Clock (java.time.Clock)5 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)4 Service (io.fabric8.kubernetes.api.model.Service)4 ServiceAccount (io.fabric8.kubernetes.api.model.ServiceAccount)4 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)4 NetworkPolicy (io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy)4 CruiseControlResources (io.strimzi.api.kafka.model.CruiseControlResources)4 CruiseControlSpec (io.strimzi.api.kafka.model.CruiseControlSpec)4 CruiseControlSpecBuilder (io.strimzi.api.kafka.model.CruiseControlSpecBuilder)4 Kafka (io.strimzi.api.kafka.model.Kafka)4 KafkaBuilder (io.strimzi.api.kafka.model.KafkaBuilder)4 BrokerCapacityBuilder (io.strimzi.api.kafka.model.balancing.BrokerCapacityBuilder)4