From e064c1c629f5488364c3ae795aa717d8897ff217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Sun, 18 Sep 2022 14:47:10 +0200 Subject: [PATCH] OpenShift - Fix missing path to JAR that breaks app start --- .../image/openshift/deployment/OpenshiftProcessor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java index 3017fc8d777ed..256a45aec62a1 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java @@ -74,6 +74,7 @@ public class OpenshiftProcessor { public static final String OPENSHIFT = "openshift"; private static final String BUILD_CONFIG_NAME = "openshift.io/build-config.name"; private static final String RUNNING = "Running"; + private static final String JAVA_APP_JAR = "JAVA_APP_JAR"; private static final int LOG_TAIL_SIZE = 10; private static final Logger LOG = Logger.getLogger(OpenshiftProcessor.class); @@ -160,8 +161,10 @@ public void openshiftRequirementsJvm(OpenshiftConfig openshiftConfig, cmd.add("java"); cmd.addAll(config.getEffectiveJvmArguments()); cmd.addAll(Arrays.asList("-jar", pathToJar)); - envProducer.produce(KubernetesEnvBuildItem.createSimpleVar("JAVA_APP_JAR", pathToJar, null)); + envProducer.produce(KubernetesEnvBuildItem.createSimpleVar(JAVA_APP_JAR, pathToJar, null)); commandProducer.produce(KubernetesCommandBuildItem.command(cmd)); + } else if (baseImage.isEmpty()) { + envProducer.produce(KubernetesEnvBuildItem.createSimpleVar(JAVA_APP_JAR, pathToJar, null)); } } }