Search in sources :

Example 6 with ZipArtifact

use of io.strimzi.api.kafka.model.connect.build.ZipArtifact in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testInsecureArtifacts.

@ParallelTest
public void testInsecureArtifacts() {
    OtherArtifact art1 = new OtherArtifactBuilder((OtherArtifact) otherArtifactNoChecksum).withInsecure(true).build();
    ZipArtifact art2 = new ZipArtifactBuilder((ZipArtifact) zipArtifactWithChecksum).withInsecure(true).build();
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(art1, art2).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/90e04094' \\", "      && 'curl' '-k' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' 'https://mydomain.tld/my2.zip' \\", "      && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/90e04094.zip' > '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'unzip' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' '-d' '/opt/kafka/plugins/my-connector-plugin/90e04094' \\", "      && 'find' '/opt/kafka/plugins/my-connector-plugin/90e04094' '-type' 'l' | 'xargs' 'rm' '-f' \\", "      && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip'", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/2c3b64c7' \\", "      && 'curl' '-k' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/2c3b64c7/my.so' 'https://mydomain.tld/download?artifact=my.so'", "USER 1001"));
}
Also used : ZipArtifact(io.strimzi.api.kafka.model.connect.build.ZipArtifact) ZipArtifactBuilder(io.strimzi.api.kafka.model.connect.build.ZipArtifactBuilder) OtherArtifact(io.strimzi.api.kafka.model.connect.build.OtherArtifact) Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) OtherArtifactBuilder(io.strimzi.api.kafka.model.connect.build.OtherArtifactBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

OtherArtifact (io.strimzi.api.kafka.model.connect.build.OtherArtifact)6 ZipArtifact (io.strimzi.api.kafka.model.connect.build.ZipArtifact)6 Artifact (io.strimzi.api.kafka.model.connect.build.Artifact)4 Build (io.strimzi.api.kafka.model.connect.build.Build)4 BuildBuilder (io.strimzi.api.kafka.model.connect.build.BuildBuilder)4 JarArtifact (io.strimzi.api.kafka.model.connect.build.JarArtifact)4 MavenArtifact (io.strimzi.api.kafka.model.connect.build.MavenArtifact)4 OtherArtifactBuilder (io.strimzi.api.kafka.model.connect.build.OtherArtifactBuilder)4 PluginBuilder (io.strimzi.api.kafka.model.connect.build.PluginBuilder)4 ZipArtifactBuilder (io.strimzi.api.kafka.model.connect.build.ZipArtifactBuilder)4 ParallelTest (io.strimzi.test.annotations.ParallelTest)4 DownloadableArtifact (io.strimzi.api.kafka.model.connect.build.DownloadableArtifact)2 JarArtifactBuilder (io.strimzi.api.kafka.model.connect.build.JarArtifactBuilder)2 TgzArtifact (io.strimzi.api.kafka.model.connect.build.TgzArtifact)2 TgzArtifactBuilder (io.strimzi.api.kafka.model.connect.build.TgzArtifactBuilder)2 InvalidConfigurationException (io.strimzi.operator.common.InvalidConfigurationException)2