shakeelansari63 commented on code in PR #26663:
URL: https://github.com/apache/superset/pull/26663#discussion_r1459215709
##########
helm/superset/templates/_helpers.tpl:
##########
@@ -61,6 +61,25 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 |
trimSuffix "-" -}}
{{- end -}}
+{{/*
+Generate Redis URL for SSL and non-SSL protocols
+*/}}
+{{- define "superset-redis-url" -}}
+ {{- if .Values.supersetNode.connections.use_redis_ssl -}}
+ {{- if .Values.supersetNode.connections.redis_password -}}
+
rediss://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/##DBNAME##?ssl_cert_reqs={{-
.Values.supersetNode.connections.use_redis_ssl.ssl_cert_reqs | default
"CERT_NONE" -}}
Review Comment:
Actually I am reusing the url in 2 places. One is this Flask Caching which
defaults to 1 if REDIS_DB is not provided.
```yaml
'CACHE_REDIS_URL': f"{{- include "superset-redis-url" . | replace
"##DBNAME##" "{env('REDIS_DB', 1)}" -}}",
```
And Other is Broker URL for Celery Config, which was earlier hardcoded with
RedisDB '0'
```yaml
class CeleryConfig:
imports = ("superset.sql_lab", )
broker_url = f"{{- include "superset-redis-url" . | replace "##DBNAME##"
"0" -}}"
result_backend = f"{{- include "superset-redis-url" . | replace
"##DBNAME##" "0" -}}"
```
Apart for DB name everything was same. So I created only 1 template and just
replaced DBNAME placeholder appropriately in those 2 places.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]