Skip to content

Commit

Permalink
Update test suite to work with flink operator bundle image (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys authored Oct 21, 2024
1 parent 879d5ed commit 1d88691
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class FlinkDeploymentTemplate {
* @return flink deployment builder
*/
public static FlinkDeploymentBuilder defaultFlinkDeployment(String namespace, String name, List<String> args) {
return new FlinkDeploymentBuilder()
FlinkDeploymentBuilder fb = new FlinkDeploymentBuilder()
.withNewMetadata()
.withName(name)
.withNamespace(namespace)
Expand All @@ -52,21 +52,12 @@ public static FlinkDeploymentBuilder defaultFlinkDeployment(String namespace, St
.withName("flink-logs")
.withMountPath("/opt/flink/log")
.endFlinkdeploymentspecVolumeMount()
.addNewVolumeMount()
.withName("flink-artifacts")
.withMountPath("/opt/flink/artifacts")
.endFlinkdeploymentspecVolumeMount()
.endFlinkdeploymentspecContainer()
.addNewVolume()
.withName("flink-logs")
.withNewEmptyDir()
.endFlinkdeploymentspecEmptyDir()
.endFlinkdeploymentspecVolume()
.addNewVolume()
.withName("flink-artifacts")
.withNewEmptyDir()
.endFlinkdeploymentspecEmptyDir()
.endFlinkdeploymentspecVolume()
.endFlinkdeploymentspecSpec()
.endPodTemplate()
.withNewJobManager()
Expand All @@ -88,6 +79,28 @@ public static FlinkDeploymentBuilder defaultFlinkDeployment(String namespace, St
.withArgs(args)
.endJob()
.endSpec();

if (Environment.FLINK_OPERATOR_BUNDLE_IMAGE.isEmpty()) {
fb.editOrNewSpec()
.editOrNewPodTemplate()
.editOrNewSpec()
.editFirstContainer()
.addNewVolumeMount()
.withName("flink-artifacts")
.withMountPath("/opt/flink/artifacts")
.endFlinkdeploymentspecVolumeMount()
.endFlinkdeploymentspecContainer()
.addNewVolume()
.withName("flink-artifacts")
.withNewEmptyDir()
.endFlinkdeploymentspecEmptyDir()
.endFlinkdeploymentspecVolume()
.endFlinkdeploymentspecSpec()
.endPodTemplate()
.endSpec();
}

return fb;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/streams/operators/OperatorInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static CompletableFuture<?> installStrimziOperator() throws IOException
}

private static CompletableFuture<?> installCertManagerOperator() throws IOException {
if (Environment.INSTALL_STRIMZI_FROM_RH_CATALOG) {
if (Environment.INSTALL_CERT_MANAGER_FROM_RH_CATALOG) {
return CertManagerOlmCatalogInstaller.install("openshift-cert-manager-operator",
"cert-manager-operator", null, "stable-v1",
"redhat-operators", "openshift-marketplace");
Expand All @@ -95,7 +95,7 @@ private static CompletableFuture<?> installFlinkOperator() throws IOException {
}

private static CompletableFuture<?> installApicurioOperator() throws IOException {
if (Environment.INSTALL_STRIMZI_FROM_RH_CATALOG) {
if (Environment.INSTALL_APICURIO_FROM_RH_CATALOG) {
return ApicurioOlmCatalogInstaller.install("service-registry-operator",
ApicurioRegistryManifestInstaller.OPERATOR_NS, null, "2.x",
"redhat-operators", "openshift-marketplace");
Expand Down

0 comments on commit 1d88691

Please sign in to comment.