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
This commit is contained in:
Stavros Kois
2022-07-04 19:15:44 +00:00
committed by GitHub
parent 0139d4d2d3
commit 37374e0e9b
6 changed files with 66 additions and 71 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ sources:
- https://github.com/jlesage/docker-czkawka - https://github.com/jlesage/docker-czkawka
- https://github.com/qarmin/czkawka - https://github.com/qarmin/czkawka
type: application type: application
version: 0.0.1 version: 0.0.2
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- duplicates - duplicates
+2 -2
View File
@@ -1,7 +1,7 @@
image: image:
repository: docker.io/jlesage/czkawka repository: tccr.io/truecharts/czkawka
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: v1.7.0@sha256:5cf6f690e7a7168f854c7f295d2e5e1866aa6a727024338d709c6f5c62afad51 tag: v1.7.0@sha256:0598756357657f7eb46f78ff0f7606db378c84053c419efc1da0608a9c505472
securityContext: securityContext:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false
+1 -1
View File
@@ -19,7 +19,7 @@ name: custom-app
sources: sources:
- https://github.com/truecharts/apps/tree/master/charts/stable/custom-app - https://github.com/truecharts/apps/tree/master/charts/stable/custom-app
type: application type: application
version: 5.1.3 version: 5.1.4
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- custom - custom
+1 -1
View File
@@ -25,7 +25,7 @@ sources:
- https://hub.docker.com/r/guacamole/guacamole - https://hub.docker.com/r/guacamole/guacamole
- http://guacamole.incubator.apache.org/doc/gug/introduction.html - http://guacamole.incubator.apache.org/doc/gug/introduction.html
type: application type: application
version: 4.0.7 version: 4.0.8
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- utilities - utilities
+61 -66
View File
@@ -166,19 +166,19 @@ initContainers:
mountPath: "/initdbdata" mountPath: "/initdbdata"
command: ["/bin/sh", "-c"] command: ["/bin/sh", "-c"]
args: args:
- > - |-
echo "Creating initdb.sql file..."; echo "Creating initdb.sql file..."
/opt/guacamole/bin/initdb.sh --postgres > /initdbdata/initdb.sql; /opt/guacamole/bin/initdb.sh --postgres >/initdbdata/initdb.sql
if [ -e /initdbdata/initdb.sql ]; if [ -e /initdbdata/initdb.sql ]; then
then echo "Init file created successfully!"
echo "Init file created successfully!"; exit 0
exit 0;
else else
echo "Init file failed to create."; echo "Init file failed to create."
exit 1; exit 1
fi; fi
2-initdb: 2-initdb:
image: "{{ .Values.postgresqlImage.repository }}:{{ .Values.postgresqlImage.tag }}" image: "{{ .Values.multiinitImage.repository }}:{{ .Values.multiinitImage.tag }}"
env: env:
- name: POSTGRES_DATABASE - name: POSTGRES_DATABASE
value: "{{ .Values.postgresql.postgresqlDatabase }}" value: "{{ .Values.postgresql.postgresqlDatabase }}"
@@ -201,23 +201,22 @@ initContainers:
mountPath: "/initdbdata" mountPath: "/initdbdata"
command: ["/bin/sh", "-c"] command: ["/bin/sh", "-c"]
args: args:
- > - |-
psql -h $POSTGRES_HOSTNAME -d $POSTGRES_DATABASE -U $POSTGRES_USER -p $POSTGRES_PORT -o '/dev/null' -c 'SELECT * FROM public.guacamole_user'; 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 ]; if [ $? -eq 0 ]; then
then echo "DB already initialized. Skipping..."
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 else
echo "Initializing DB's schema..."; echo "DB's schema failed to initialize."
psql -h $POSTGRES_HOSTNAME -d $POSTGRES_DATABASE -U $POSTGRES_USER -p $POSTGRES_PORT -a -w -f /initdbdata/initdb.sql; exit 1
if [ $? -eq 0 ]; fi
then fi
echo "DB's schema initialized successfully!";
exit 0;
else
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. # Until they release an image with the updated driver, we need to manually replace it.
# https://issues.apache.org/jira/browse/GUACAMOLE-1433 # https://issues.apache.org/jira/browse/GUACAMOLE-1433
# https://github.com/apache/guacamole-client/pull/655 # https://github.com/apache/guacamole-client/pull/655
@@ -232,37 +231,34 @@ initContainers:
mountPath: "/opt/guacamole/postgresql-hack" mountPath: "/opt/guacamole/postgresql-hack"
command: ["/bin/sh", "-c"] command: ["/bin/sh", "-c"]
args: args:
- > - |-
echo "Checing postgresql driver version..."; echo "Checking postgresql driver version..."
if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; then
then echo "Version found is correct."
echo "Version found is correct."; exit 0
exit 0; else
else echo "Old version found. Will try to download a known-to-work version."
echo "Old version found. Will try to download a known-to-work version."; echo "Downloading (postgresql-42.2.24.jre7.jar)..."
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"
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
if [ -e /opt/guacamole/postgresql-hack/postgresql-42.2.24.jre7.jar ]; echo "Downloaded successfully!"
then cp -r /opt/guacamole/postgresql/* /opt/guacamole/postgresql-hack/
echo "Downloaded successfully!"; if [ -e /opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar ]; then
cp -r /opt/guacamole/postgresql/* /opt/guacamole/postgresql-hack/; echo "Removing old version... (postgresql-9.4-1201.jdbc41.jar)"
if [ -e /opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar ]; rm "/opt/guacamole/postgresql-hack/postgresql-9.4-1201.jdbc41.jar"
then if [ $? -eq 0 ]; then
echo "Removing old version... (postgresql-9.4-1201.jdbc41.jar)"; echo "Removed successfully!"
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;
else else
echo "Failed to download."; echo "Failed to remove."
exit 1; exit 1
fi; fi
fi; fi
else
echo "Failed to download."
exit 1
fi
fi
4-temp-hack: 4-temp-hack:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
securityContext: securityContext:
@@ -275,12 +271,11 @@ initContainers:
mountPath: "/opt/guacamole/postgresql" mountPath: "/opt/guacamole/postgresql"
command: ["/bin/sh", "-c"] command: ["/bin/sh", "-c"]
args: args:
- > - |-
echo "Copying postgres driver into the final destination."; echo "Copying postgres driver into the final destination."
cp -r /opt/guacamole/postgresql-hack/* /opt/guacamole/postgresql/; cp -r /opt/guacamole/postgresql-hack/* /opt/guacamole/postgresql/
if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; if [ -e /opt/guacamole/postgresql/postgresql-42.2.24.jre7.jar ]; then
then echo "Driver copied successfully!"
echo "Driver copied successfully!"; else
else echo "Failed to copy the driver"
echo "Failed to copy the driver"; fi
fi;