From 37374e0e9b97d85cc98e797bc6e6a7c0689f954e Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 4 Jul 2022 22:15:44 +0300 Subject: [PATCH] fix(guacamole-client): adjust initcontainers with new image (#3069) * fix(guacamole-client): add postgres image in values * use multiinit image and cleanup shellscript format * update image ref of czkawka * better scalars * quote --- charts/incubator/czkawka/Chart.yaml | 2 +- charts/incubator/czkawka/values.yaml | 4 +- charts/stable/custom-app/Chart.yaml | 2 +- charts/stable/guacamole-client/Chart.yaml | 2 +- charts/stable/guacamole-client/values.yaml | 127 +++++++++--------- ...mamd.yaml => controllerExpertCommand.yaml} | 0 6 files changed, 66 insertions(+), 71 deletions(-) rename templates/questions/{controllerExpertCommamd.yaml => controllerExpertCommand.yaml} (100%) diff --git a/charts/incubator/czkawka/Chart.yaml b/charts/incubator/czkawka/Chart.yaml index ac723ecde5b..0e69748db5d 100644 --- a/charts/incubator/czkawka/Chart.yaml +++ b/charts/incubator/czkawka/Chart.yaml @@ -23,7 +23,7 @@ sources: - https://github.com/jlesage/docker-czkawka - https://github.com/qarmin/czkawka type: application -version: 0.0.1 +version: 0.0.2 annotations: truecharts.org/catagories: | - duplicates diff --git a/charts/incubator/czkawka/values.yaml b/charts/incubator/czkawka/values.yaml index 79356346ec9..98ed6a2b5b0 100644 --- a/charts/incubator/czkawka/values.yaml +++ b/charts/incubator/czkawka/values.yaml @@ -1,7 +1,7 @@ image: - repository: docker.io/jlesage/czkawka + repository: tccr.io/truecharts/czkawka pullPolicy: IfNotPresent - tag: v1.7.0@sha256:5cf6f690e7a7168f854c7f295d2e5e1866aa6a727024338d709c6f5c62afad51 + tag: v1.7.0@sha256:0598756357657f7eb46f78ff0f7606db378c84053c419efc1da0608a9c505472 securityContext: readOnlyRootFilesystem: false diff --git a/charts/stable/custom-app/Chart.yaml b/charts/stable/custom-app/Chart.yaml index 864d69fca50..d3c2d8e13bf 100644 --- a/charts/stable/custom-app/Chart.yaml +++ b/charts/stable/custom-app/Chart.yaml @@ -19,7 +19,7 @@ name: custom-app sources: - https://github.com/truecharts/apps/tree/master/charts/stable/custom-app type: application -version: 5.1.3 +version: 5.1.4 annotations: truecharts.org/catagories: | - custom diff --git a/charts/stable/guacamole-client/Chart.yaml b/charts/stable/guacamole-client/Chart.yaml index 6ae912aabaa..795b6579818 100644 --- a/charts/stable/guacamole-client/Chart.yaml +++ b/charts/stable/guacamole-client/Chart.yaml @@ -25,7 +25,7 @@ sources: - https://hub.docker.com/r/guacamole/guacamole - http://guacamole.incubator.apache.org/doc/gug/introduction.html type: application -version: 4.0.7 +version: 4.0.8 annotations: truecharts.org/catagories: | - utilities diff --git a/charts/stable/guacamole-client/values.yaml b/charts/stable/guacamole-client/values.yaml index 772d2c49d69..6145fdf08c8 100644 --- a/charts/stable/guacamole-client/values.yaml +++ b/charts/stable/guacamole-client/values.yaml @@ -166,19 +166,19 @@ initContainers: mountPath: "/initdbdata" command: ["/bin/sh", "-c"] args: - - > - echo "Creating initdb.sql file..."; - /opt/guacamole/bin/initdb.sh --postgres > /initdbdata/initdb.sql; - if [ -e /initdbdata/initdb.sql ]; - then - echo "Init file created successfully!"; - exit 0; + - |- + echo "Creating initdb.sql file..." + /opt/guacamole/bin/initdb.sh --postgres >/initdbdata/initdb.sql + if [ -e /initdbdata/initdb.sql ]; then + echo "Init file created successfully!" + exit 0 else - echo "Init file failed to create."; - exit 1; - fi; + echo "Init file failed to create." + exit 1 + fi + 2-initdb: - image: "{{ .Values.postgresqlImage.repository }}:{{ .Values.postgresqlImage.tag }}" + image: "{{ .Values.multiinitImage.repository }}:{{ .Values.multiinitImage.tag }}" env: - name: POSTGRES_DATABASE value: "{{ .Values.postgresql.postgresqlDatabase }}" @@ -201,23 +201,22 @@ initContainers: mountPath: "/initdbdata" command: ["/bin/sh", "-c"] args: - - > - psql -h $POSTGRES_HOSTNAME -d $POSTGRES_DATABASE -U $POSTGRES_USER -p $POSTGRES_PORT -o '/dev/null' -c 'SELECT * FROM public.guacamole_user'; - if [ $? -eq 0 ]; - then - echo "DB already initialized. Skipping..."; + - |- + psql -h "$POSTGRES_HOSTNAME" -d "$POSTGRES_DATABASE" -U "$POSTGRES_USER" -p "$POSTGRES_PORT" -o '/dev/null' -c 'SELECT * FROM public.guacamole_user' + if [ $? -eq 0 ]; then + echo "DB already initialized. Skipping..." + else + echo "Initializing DB's schema..." + psql -h "$POSTGRES_HOSTNAME" -d "$POSTGRES_DATABASE" -U "$POSTGRES_USER" -p "$POSTGRES_PORT" -a -w -f /initdbdata/initdb.sql + if [ $? -eq 0 ]; then + echo "DB's schema initialized successfully!" + exit 0 else - echo "Initializing DB's schema..."; - psql -h $POSTGRES_HOSTNAME -d $POSTGRES_DATABASE -U $POSTGRES_USER -p $POSTGRES_PORT -a -w -f /initdbdata/initdb.sql; - if [ $? -eq 0 ]; - then - echo "DB's schema initialized successfully!"; - exit 0; - else - echo "DB's schema failed to initialize."; - exit 1; - fi; - fi; + echo "DB's schema failed to initialize." + exit 1 + fi + fi + # Until they release an image with the updated driver, we need to manually replace it. # https://issues.apache.org/jira/browse/GUACAMOLE-1433 # https://github.com/apache/guacamole-client/pull/655 @@ -232,37 +231,34 @@ initContainers: mountPath: "/opt/guacamole/postgresql-hack" command: ["/bin/sh", "-c"] args: - - > - echo "Checing postgresql driver version..."; - if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; - then - echo "Version found is correct."; - exit 0; - else - echo "Old version found. Will try to download a known-to-work version."; - echo "Downloading (postgresql-42.2.24.jre7.jar)..."; - curl -L "https://jdbc.postgresql.org/download/postgresql-42.2.24.jre7.jar" > "/opt/guacamole/postgresql-hack/postgresql-42.2.24.jre7.jar"; - if [ -e /opt/guacamole/postgresql-hack/postgresql-42.2.24.jre7.jar ]; - then - echo "Downloaded successfully!"; - cp -r /opt/guacamole/postgresql/* /opt/guacamole/postgresql-hack/; - if [ -e /opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar ]; - then - echo "Removing old version... (postgresql-9.4-1201.jdbc41.jar)"; - rm "/opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar"; - if [ $? -eq 0 ]; - then - echo "Removed successfully!"; - else - echo "Failed to remove."; - exit 1; - fi; - fi; + - |- + echo "Checking postgresql driver version..." + if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; then + echo "Version found is correct." + exit 0 + else + echo "Old version found. Will try to download a known-to-work version." + echo "Downloading (postgresql-42.2.24.jre7.jar)..." + curl -L "https://jdbc.postgresql.org/download/postgresql-42.2.24.jre7.jar" >"/opt/guacamole/postgresql-hack/postgresql-42.2.24.jre7.jar" + if [ -e /opt/guacamole/postgresql-hack/postgresql-42.2.24.jre7.jar ]; then + echo "Downloaded successfully!" + cp -r /opt/guacamole/postgresql/* /opt/guacamole/postgresql-hack/ + if [ -e /opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar ]; then + echo "Removing old version... (postgresql-9.4-1201.jdbc41.jar)" + rm "/opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar" + if [ $? -eq 0 ]; then + echo "Removed successfully!" else - echo "Failed to download."; - exit 1; - fi; - fi; + echo "Failed to remove." + exit 1 + fi + fi + else + echo "Failed to download." + exit 1 + fi + fi + 4-temp-hack: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" securityContext: @@ -275,12 +271,11 @@ initContainers: mountPath: "/opt/guacamole/postgresql" command: ["/bin/sh", "-c"] args: - - > - echo "Copying postgres driver into the final destination."; - cp -r /opt/guacamole/postgresql-hack/* /opt/guacamole/postgresql/; - if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; - then - echo "Driver copied successfully!"; - else - echo "Failed to copy the driver"; - fi; + - |- + echo "Copying postgres driver into the final destination." + cp -r /opt/guacamole/postgresql-hack/* /opt/guacamole/postgresql/ + if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; then + echo "Driver copied successfully!" + else + echo "Failed to copy the driver" + fi diff --git a/templates/questions/controllerExpertCommamd.yaml b/templates/questions/controllerExpertCommand.yaml similarity index 100% rename from templates/questions/controllerExpertCommamd.yaml rename to templates/questions/controllerExpertCommand.yaml