use of io.strimzi.api.kafka.model.connect.build.PluginBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectDockerfileTest method testChecksumJarArtifact.
@ParallelTest
public void testChecksumJarArtifact() {
Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(jarArtifactWithChecksum).build()).build();
KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/0df6d15c' \\", " && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar' 'https://mydomain.tld/my2.jar' \\", " && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar' > '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512' \\", " && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512' \\", " && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512'", "USER 1001"));
}
use of io.strimzi.api.kafka.model.connect.build.PluginBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectDockerfileTest method testMultipleJarArtifact.
@ParallelTest
public void testMultipleJarArtifact() {
Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(jarArtifactNoChecksum, jarArtifactWithChecksum).build()).build();
KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/51e5038c' \\", " && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/51e5038c/51e5038c.jar' 'https://mydomain.tld/my.jar'", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/0df6d15c' \\", " && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar' 'https://mydomain.tld/my2.jar' \\", " && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar' > '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512' \\", " && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512' \\", " && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/0df6d15c/0df6d15c.jar.sha512'", "USER 1001"));
}
use of io.strimzi.api.kafka.model.connect.build.PluginBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectDockerfileTest method testNoChecksumTgzArtifact.
@ParallelTest
public void testNoChecksumTgzArtifact() {
Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(tgzArtifactNoChecksum).build()).build();
KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/6718766b' \\", " && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/6718766b.tgz' 'https://mydomain.tld/my.tgz' \\", " && 'tar' 'xvfz' '/opt/kafka/plugins/my-connector-plugin/6718766b.tgz' '-C' '/opt/kafka/plugins/my-connector-plugin/6718766b' \\", " && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/6718766b.tgz'", "USER 1001"));
}
use of io.strimzi.api.kafka.model.connect.build.PluginBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectDockerfileTest method testNoArtifacts.
@ParallelTest
public void testNoArtifacts() {
Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(emptyList()).build()).build();
KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "USER 1001"));
}
use of io.strimzi.api.kafka.model.connect.build.PluginBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectDockerfileTest method testNoChecksumJarArtifact.
@ParallelTest
public void testNoChecksumJarArtifact() {
Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(jarArtifactNoChecksum).build()).build();
KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/51e5038c' \\", " && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/51e5038c/51e5038c.jar' 'https://mydomain.tld/my.jar'", "USER 1001"));
}
Aggregations