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 22:15:44 +03: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/qarmin/czkawka
type: application
version: 0.0.1
version: 0.0.2
annotations:
truecharts.org/catagories: |
- duplicates
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+61 -66
View File
@@ -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