diff --git a/docker_build/Dockerfile.prod b/docker_build/Dockerfile.prod index aab5078302..97ac37235c 100644 --- a/docker_build/Dockerfile.prod +++ b/docker_build/Dockerfile.prod @@ -6,7 +6,8 @@ RUN adduser opsmx \ && usermod -aG wheel opsmx \ && mkdir -p /opsmx/workdir/logs \ && mkdir -p /opt/spinnaker/config \ - && mkdir -p /opt/spinnaker/plugins + && mkdir -p /opt/spinnaker/plugins \ + && mkdir -p /opsmx/conf # Install procps(ps) RUN yum install -y wget @@ -43,7 +44,7 @@ RUN sed -i 's/"VERIFICATION_SHASUM"/'\""$(sha512sum /opt/spinnaker/plugins/Verif COPY /gate-web/build/install/gate /opsmx/workdir/gate # Copy jaeger jar COPY /jaeger/opentelemetry-javaagent.jar /${WORK_DIR}/jaeger/opentelemetry-javaagent.jar -RUN chown -R opsmx:root ${WORK_DIR}/* /opt/* && chmod 777 /opt/* ${WORK_DIR}/* +RUN chown -R opsmx:root ${WORK_DIR}/* /opt/* ${CONF_DIR} && chmod 777 /opt/* ${WORK_DIR}/* ${CONF_DIR} # === Start Gate Service === USER opsmx diff --git a/docker_build/Dockerfile.rhel8-ubi8 b/docker_build/Dockerfile.rhel8-ubi8 index 498436519a..1c0652d279 100644 --- a/docker_build/Dockerfile.rhel8-ubi8 +++ b/docker_build/Dockerfile.rhel8-ubi8 @@ -15,7 +15,8 @@ RUN adduser opsmx \ && mkdir -p /opsmx/workdir/logs \ && mkdir -p /opt/spinnaker/config \ && mkdir -p /opt/spinnaker/plugins \ - && mkdir -p /opt/gate/plugins + && mkdir -p /opt/gate/plugins \ + && mkdir -p /opsmx/conf # Install procps(ps) RUN yum install -y procps nginx net-tools wget @@ -28,6 +29,7 @@ RUN yum -y update #######Gate Dependencies######### ENV WORK_DIR=/opsmx/workdir +ENV CONF_DIR=/opsmx/conf ENV JAVA_HOME=/usr/lib/jvm/jre-17-openjdk COPY /docker_build/run.sh /usr/local/bin/run.sh RUN chmod +x /usr/local/bin/run.sh @@ -58,7 +60,7 @@ RUN sed -i 's/"VERIFICATION_SHASUM"/'\""$(sha512sum /opt/spinnaker/plugins/Verif COPY /gate-web/build/install/gate /opsmx/workdir/gate # Copy jaeger jar COPY /jaeger/opentelemetry-javaagent.jar /${WORK_DIR}/jaeger/opentelemetry-javaagent.jar -RUN chown -R opsmx:root ${WORK_DIR}/* /opt/* && chmod 777 /opt/* ${WORK_DIR}/* +RUN chown -R opsmx:root ${WORK_DIR}/* /opt/* ${CONF_DIR} && chmod 777 /opt/* ${WORK_DIR}/* ${CONF_DIR} # === Start Gate Service === USER opsmx diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/PostConnectionConfiguringJedisConnectionFactory.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/PostConnectionConfiguringJedisConnectionFactory.java index 262292d154..bce5c691d6 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/PostConnectionConfiguringJedisConnectionFactory.java +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/PostConnectionConfiguringJedisConnectionFactory.java @@ -99,13 +99,18 @@ public PostConnectionConfiguringJedisConnectionFactory( log.info("Certificate has been added to the KeyStore successfully."); } catch (Exception e) { + log.error("Error in creating jks file: ", e); throw e; } finally { - certInputStream.close(); - jksOutputStream.close(); + if (certInputStream != null) { + certInputStream.close(); + } + if (jksOutputStream != null) { + jksOutputStream.close(); + } } - System.setProperty("javax.net.ssl.trustStore", "/opsmx/conf/redis-truststore.jks"); + System.setProperty("javax.net.ssl.trustStore", jksFilePath); System.setProperty("javax.net.ssl.trustStorePassword", this.password); } }