Search in sources :

Example 6 with RackBuilder

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

the class KafkaClusterTest method testImagePullPolicy.

@ParallelTest
public void testImagePullPolicy() {
    Kafka kafkaAssembly = ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configuration, emptyMap());
    kafkaAssembly.getSpec().getKafka().setRack(new RackBuilder().withTopologyKey("topology-key").build());
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    StatefulSet sts = kc.generateStatefulSet(true, ImagePullPolicy.ALWAYS, null, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getInitContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.ALWAYS.toString()));
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.ALWAYS.toString()));
    sts = kc.generateStatefulSet(true, ImagePullPolicy.IFNOTPRESENT, null, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getInitContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.IFNOTPRESENT.toString()));
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.IFNOTPRESENT.toString()));
}
Also used : RackBuilder(io.strimzi.api.kafka.model.RackBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 7 with RackBuilder

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

the class KafkaClusterTest method testImagePullPolicy.

@ParallelTest
public void testImagePullPolicy() {
    Kafka kafkaAssembly = ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configuration, emptyMap());
    kafkaAssembly.getSpec().getKafka().setRack(new RackBuilder().withTopologyKey("topology-key").build());
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    StatefulSet sts = kc.generateStatefulSet(true, ImagePullPolicy.ALWAYS, null, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getInitContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.ALWAYS.toString()));
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.ALWAYS.toString()));
    sts = kc.generateStatefulSet(true, ImagePullPolicy.IFNOTPRESENT, null, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getInitContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.IFNOTPRESENT.toString()));
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.IFNOTPRESENT.toString()));
}
Also used : RackBuilder(io.strimzi.api.kafka.model.RackBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 8 with RackBuilder

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

the class ZookeeperClusterTest method testImagePullPolicy.

@ParallelTest
public void testImagePullPolicy() {
    Kafka kafkaAssembly = ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configurationJson, emptyMap());
    kafkaAssembly.getSpec().getKafka().setRack(new RackBuilder().withTopologyKey("topology-key").build());
    ZookeeperCluster kc = ZookeeperCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    StatefulSet sts = zc.generateStatefulSet(true, ImagePullPolicy.ALWAYS, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.ALWAYS.toString()));
    sts = zc.generateStatefulSet(true, ImagePullPolicy.IFNOTPRESENT, null);
    assertThat(sts.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy(), is(ImagePullPolicy.IFNOTPRESENT.toString()));
}
Also used : RackBuilder(io.strimzi.api.kafka.model.RackBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

RackBuilder (io.strimzi.api.kafka.model.RackBuilder)8 Kafka (io.strimzi.api.kafka.model.Kafka)6 NetworkPolicy (io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy)4 ParallelTest (io.strimzi.test.annotations.ParallelTest)4 StatefulSet (io.fabric8.kubernetes.api.model.apps.StatefulSet)3 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)2 ConfigMapBuilder (io.fabric8.kubernetes.api.model.ConfigMapBuilder)2 Service (io.fabric8.kubernetes.api.model.Service)2 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)2 PodDisruptionBudget (io.fabric8.kubernetes.api.model.policy.v1.PodDisruptionBudget)2 ClusterRoleBinding (io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding)2 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)2 KafkaConnectorList (io.strimzi.api.kafka.KafkaConnectorList)2 KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)2 KafkaConnectResources (io.strimzi.api.kafka.model.KafkaConnectResources)2 KafkaConnector (io.strimzi.api.kafka.model.KafkaConnector)2 KafkaJmxAuthenticationPasswordBuilder (io.strimzi.api.kafka.model.KafkaJmxAuthenticationPasswordBuilder)2 KafkaJmxOptionsBuilder (io.strimzi.api.kafka.model.KafkaJmxOptionsBuilder)2 ConnectorPlugin (io.strimzi.api.kafka.model.connect.ConnectorPlugin)2 ConnectorPluginBuilder (io.strimzi.api.kafka.model.connect.ConnectorPluginBuilder)2