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 3 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
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
28 changes: 18 additions & 10 deletions charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,29 @@ 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 }}
{{ if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

i think semverCompare might give you trouble with image tags that are like 3.xx.x-stable or -edge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested against the -edge ones and it works fine. I think it supports them because it's supposed to support SHAs there. That's why the comparison is against 3.93.0-0.

I might add extra tests against a helm chart that has those versions just in case!

- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
{{- else }}
{{ if ( not $.Values.dbconnector.java.enabled ) }}
{{ else if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( not .Values.jobRunner.enabled ) }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) ( $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) ( not $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( not .Values.jobRunner.enabled ) ( $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER,JAVA_DBCONNECTOR
{{ else }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
{{ end }}
{{ if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( not $.Values.dbconnector.java.enabled ) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

the long if list feels like trouble, esp if we want to change how we construct these in the future (which we'll certainly do, esp with splitting out main backend and dbc)..i wonder if we could do something like
`value: MAIN_BACKEND{{ if ",DB_CONNECTOR" else "" }}{{if ",JAVA_DBCONNECTOR" else "" }}

Copy link
Contributor Author

@jjlgao jjlgao Nov 16, 2024

Choose a reason for hiding this comment

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

maybe, that's a good idea let me try it

- 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
23 changes: 20 additions & 3 deletions charts/retool/templates/deployment_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,29 @@ spec:
value: {{ template "retool.deploymentTemplateVersion" . }}
- name: NODE_ENV
value: production
{{ if ( not $.Values.dbconnector.java.enabled ) }}
{{ if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
{{ else if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( not .Values.jobRunner.enabled ) }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) ( $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( .Values.jobRunner.enabled ) ( not $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
{{ else if and ( not or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( not .Values.jobRunner.enabled ) ( $.Values.dbconnector.java.enabled ) }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER,JAVA_DBCONNECTOR
{{ else }}
- name: SERVICE_TYPE
value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
{{ end }}
{{ if and ( or (eq "latest" $.Values.image.tag ) ( semverCompare ">= 3.93.0-0" $.Values.image.tag ) ) ( 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