Skip to content

Commit ef685ff

Browse files
committed
[Superset] Fixed init script in case of no database discovery
1 parent 5633041 commit ef685ff

2 files changed

Lines changed: 21 additions & 18 deletions

File tree

charts/superset/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords:
66
- BI
77
- Visualization
88
home: https://superset.apache.org/
9-
sources:
9+
sources:
1010
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/superset
1111
- https://github.com/apache/superset
1212
# A chart can be either an 'application' or a 'library' chart.
@@ -22,16 +22,16 @@ type: application
2222
# This is the chart version. This version number should be incremented each time you make changes
2323
# to the chart and its templates, including the app version.
2424
# Versions are expected to follow Semantic Versioning (https://semver.org/)
25-
version: 0.1.5
25+
version: 0.1.6
2626

2727
# This is the version number of the application being deployed. This version number should be
2828
# incremented each time you make changes to the application. Versions are not expected to
2929
# follow Semantic Versioning. They should reflect the version the application is using.
3030

3131
dependencies:
3232
- name: superset
33-
version: 0.12.11
33+
version: 0.13.5
3434
repository: https://apache.github.io/superset
3535
- name: library-chart
36-
version: 1.5.23
36+
version: 1.5.31
3737
repository: https://inseefrlab.github.io/helm-charts-interactive-services

charts/superset/templates/_discovery.tpl

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create the name of the config map S3 to use
3131
{{- $data := dict "postgres" $postgres "service" $service "index" $index "username" $username "password" $password "database" $database "port" $port}}
3232
{{- if $test }}
3333
{{ printf "databases:" | indent 2 }}
34-
{{- $test = 0}}
34+
{{- $test = 0 }}
3535
{{- end }}
3636
{{- template "superset.postgres" $data -}}
3737
{{- end -}}
@@ -45,20 +45,20 @@ Create the name of the config map S3 to use
4545
{{- $data := dict "elastic" $elastic "service" $service "name" $name "port" $port "password" $password "username" $username "tls" $tls }}
4646
{{- if $test }}
4747
{{ printf "databases:" | indent 2 }}
48-
{{- $test = 0}}
48+
{{- $test = 0 }}
4949
{{- end }}
5050
{{- template "superset.elastic" $data -}}
5151
{{- end -}}
5252
{{- if and (index $secret "metadata" "annotations" "onyxia/discovery") (eq "trino" (index $secret "metadata" "annotations" "onyxia/discovery" | toString)) }}
5353
{{- $service:= ( index $secret.data "trino-service" | default "") | b64dec }}
54-
{{- $username:= ( index $secret.data "trino-username") | b64dec }}
55-
{{- $password:= ( index $secret.data "trino-password") | b64dec }}
56-
{{- $database:= ( index $secret.data "trino-database") | b64dec }}
57-
{{- $port:= ( index $secret.data "trino-port") | b64dec }}
54+
{{- $username:= ( index $secret.data "trino-username") | b64dec }}
55+
{{- $password:= ( index $secret.data "trino-password") | b64dec }}
56+
{{- $database:= ( index $secret.data "trino-database") | b64dec }}
57+
{{- $port:= ( index $secret.data "trino-port") | b64dec }}
5858
{{- $data := dict "trino" $trino "service" $service "index" $index "username" $username "password" $password "database" $database "port" $port}}
5959
{{- if $test }}
6060
{{ printf "databases:" | indent 2 }}
61-
{{- $test = 0}}
61+
{{- $test = 0 }}
6262
{{- end }}
6363
{{- template "superset.trino" $data -}}
6464
{{- end -}}
@@ -68,13 +68,16 @@ Create the name of the config map S3 to use
6868
{{- $data := dict "spark" $spark "service" $service "index" $index "port" $port}}
6969
{{- if $test }}
7070
{{ printf "databases:" | indent 2 }}
71-
{{- $test = 0}}
71+
{{- $test = 0 }}
7272
{{- end }}
7373
{{- template "superset.spark" $data -}}
7474
{{- end -}}
7575
{{- end -}}
76-
{{- end -}}
77-
{{- end -}}
76+
{{- end -}}
77+
{{- if eq $test 1 }}
78+
{{ printf "databases: []" | indent 2 }}
79+
{{- end -}}
80+
{{- end -}}
7881

7982
{{- define "superset.postgres" -}}
8083
{{- $postgres:= .postgres }}
@@ -92,7 +95,7 @@ Create the name of the config map S3 to use
9295
{{ printf "sqlalchemy_uri: postgresql://%s:%s/%s?user=%s&password=%s" $service $port $database $username $password | indent 4}}
9396
{{ printf "tables: []" | indent 4}}
9497
{{- end }}
95-
{{- end -}}
98+
{{- end -}}
9699

97100
{{- define "superset.elastic" -}}
98101
{{- $elastic:= .elastic }}
@@ -118,7 +121,7 @@ Create the name of the config map S3 to use
118121
{{- end }}
119122
{{ printf "tables: []" | indent 4}}
120123
{{- end }}
121-
{{- end -}}
124+
{{- end -}}
122125

123126
{{- define "superset.trino" -}}
124127
{{- $trino:= .trino }}
@@ -136,7 +139,7 @@ Create the name of the config map S3 to use
136139
{{ printf "sqlalchemy_uri: trino://%s:%s@%s:%s/%s" $username $password $service $port $database | indent 4}}
137140
{{ printf "tables: []" | indent 4}}
138141
{{- end }}
139-
{{- end -}}
142+
{{- end -}}
140143

141144
{{- define "superset.spark" -}}
142145
{{- $spark:= .spark }}
@@ -151,4 +154,4 @@ Create the name of the config map S3 to use
151154
{{ printf "sqlalchemy_uri: hive://%s:%s/" $service $port | indent 4}}
152155
{{ printf "tables: []" | indent 4}}
153156
{{- end }}
154-
{{- end -}}
157+
{{- end -}}

0 commit comments

Comments
 (0)