Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Update chart to handle the opt-in mechanism for Java dbconnecto… #190

Merged
merged 9 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/kubeconform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ for CHART_DIR in ${CHART_DIRS}; do
echo "Running kubeconform for folder: '$CHART_DIR'"
helm dep up "${CHART_DIR}"
for VALUES_FILE in $(find "${CHART_DIR}/ci" -name '*values.yaml'); do
echo "== Checking values file: ${VALUES_FILE}"
helm template --kube-version "${KUBERNETES_VERSION#v}" --values "${VALUES_FILE}" "${CHART_DIR}" \
| ./kubeconform --strict --summary --kubernetes-version "${KUBERNETES_VERSION#v}"
for OPTION_FILE in $(find "${CHART_DIR}/ci" -name '*option.yaml'); do
echo "== Checking values file: ${VALUES_FILE} and option file: ${OPTION_FILE}"
helm template --kube-version "${KUBERNETES_VERSION#v}" --values "${VALUES_FILE}" --values "${OPTION_FILE}" "${CHART_DIR}" \
| ./kubeconform --strict --summary --kubernetes-version "${KUBERNETES_VERSION#v}"
done
done
done
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: retool
description: A Helm chart for Kubernetes
type: application
version: 6.2.10
version: 6.2.11
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions charts/retool/ci/test-edge-release-option.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
image:
tag: "3.5000.0-edge"
2 changes: 2 additions & 0 deletions charts/retool/ci/test-stable-release-option.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
image:
tag: "3.0.0-stable"
29 changes: 18 additions & 11 deletions charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,28 @@ spec:
value: {{ template "retool.deploymentTemplateVersion" . }}
- name: NODE_ENV
value: production
{{- if include "retool.jobRunner.enabled" . }}
{{ if ( not $.Values.dbconnector.java.enabled ) }}
- name: DISABLE_JAVA_DBCONNECTOR
value: "true"
{{ end }}
{{- $retool_version_with_java_dbconnector_opt_out := ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) }}
{{- $serviceType := list "MAIN_BACKEND" "DB_CONNECTOR" "DB_SSH_CONNECTOR" }}
{{- /*
JAVA_DBCONNECTOR in the service type only applies before the version of Retool that changes it to opt-out (3.93.0-edge),
and only if the Java dbconnector is enabled in values.yaml.
*/}}
{{- if and ( not $retool_version_with_java_dbconnector_opt_out ) ( $.Values.dbconnector.java.enabled ) }}
{{- $serviceType = append $serviceType "JAVA_DBCONNECTOR" }}
{{- end }}
{{- /*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love the comments!

It may seem counterintuitive to add the JOBS_RUNNER service type only without a jobs runner.
The reason for this is that the backend needs to act as a jobs runner, if the jobs runner is not enabled.
*/}}
{{- if not .Values.jobRunner.enabled }}
{{- $serviceType = append $serviceType "JOBS_RUNNER" }}
{{- end }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
{{- else }}
{{ if ( not $.Values.dbconnector.java.enabled ) }}
value: {{ join "," $serviceType }}
{{ if and $retool_version_with_java_dbconnector_opt_out ( not $.Values.dbconnector.java.enabled ) }}
- name: DISABLE_JAVA_DBCONNECTOR
value: "true"
{{ end }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
{{- end }}
- name: CLIENT_ID
value: {{ default "" .Values.config.auth.google.clientId }}
- name: COOKIE_INSECURE
Expand Down
15 changes: 12 additions & 3 deletions charts/retool/templates/deployment_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,21 @@ spec:
value: {{ template "retool.deploymentTemplateVersion" . }}
- name: NODE_ENV
value: production
{{ if ( not $.Values.dbconnector.java.enabled ) }}
{{- $retool_version_with_java_dbconnector_opt_out := ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) }}
{{- $serviceType := list "WORKFLOW_BACKEND" "DB_CONNECTOR" "DB_SSH_CONNECTOR" }}
{{- /*
JAVA_DBCONNECTOR in the service type only applies before the version of Retool that changes it to opt-out (3.93.0-edge),
and only if the Java dbconnector is enabled in values.yaml.
*/}}
{{- if and ( not $retool_version_with_java_dbconnector_opt_out ) ( $.Values.dbconnector.java.enabled ) }}
{{- $serviceType = append $serviceType "JAVA_DBCONNECTOR" }}
{{- end }}
- name: SERVICE_TYPE
value: {{ join "," $serviceType }}
{{ if and $retool_version_with_java_dbconnector_opt_out ( not $.Values.dbconnector.java.enabled ) }}
- name: DISABLE_JAVA_DBCONNECTOR
value: "true"
{{ end }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
- name: DBCONNECTOR_POSTGRES_POOL_MAX_SIZE
value: "100"
- name: DBCONNECTOR_QUERY_TIMEOUT_MS
Expand Down
Loading