File tree Expand file tree Collapse file tree 8 files changed +24
-0
lines changed Expand file tree Collapse file tree 8 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,19 @@ Create the port of the Redis database
291291{ {- end } }
292292{ {- end } }
293293
294+ { {/*
295+ Create the username of the Redis database
296+ */} }
297+ { {- define " diode.redis.username" -} }
298+ { {- if .Values.redis.enabled -} }
299+ { {- printf " " } }
300+ { {- else if and .Values.externalRedis (hasKey .Values.externalRedis " username" ) -} }
301+ { {- .Values.externalRedis.username } }
302+ { {- else -} }
303+ { {- fail " externalRedis.username must be defined when redis.enabled is false" } }
304+ { {- end } }
305+ { {- end } }
306+
294307{ {/*
295308Create the database name for PostgreSQL
296309*/} }
Original file line number Diff line number Diff line change 1717 SENTRY_DSN : {{ $config.sentryDsn | quote }}
1818 REDIS_HOST : {{ include "diode.redis.hostname" . | quote }}
1919 REDIS_PORT : {{ include "diode.redis.port" . | quote }}
20+ REDIS_USERNAME : {{ include "diode.redis.username" . | quote }}
2021 {{- if and .Values.externalRedis.tls .Values.externalRedis.tls.enabled }}
2122 REDIS_TLS_ENABLED : " true"
2223 REDIS_TLS_SKIP_VERIFY : {{ .Values.externalRedis.tls.skipVerify | default false | quote }}
Original file line number Diff line number Diff line change 1717 SENTRY_DSN : {{ $config.sentryDsn | quote }}
1818 REDIS_HOST : {{ include "diode.redis.hostname" . | quote }}
1919 REDIS_PORT : {{ include "diode.redis.port" . | quote }}
20+ REDIS_USERNAME : {{ include "diode.redis.username" . | quote }}
2021 REDIS_DB : {{ $config.redisDb | default "0" | quote }}
2122 REDIS_STREAM_DB : {{ $config.redisStreamDb | default "1" | quote }}
2223 {{- if and .Values.externalRedis.tls .Values.externalRedis.tls.enabled }}
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ externalRedis:
5757 hostname : localhost
5858 # -- port
5959 port : 6379
60+ # -- username (optional, Redis 6+)
61+ username : " "
6062 tls :
6163 # -- enable TLS
6264 enabled : false
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ services:
2323 - REDIS_PASSWORD=${REDIS_PASSWORD}
2424 - REDIS_HOST=${REDIS_HOST}
2525 - REDIS_PORT=${REDIS_PORT}
26+ - REDIS_USERNAME=""
2627 - SENTRY_DSN=${SENTRY_DSN}
2728 - TELEMETRY_METRICS_EXPORTER=${TELEMETRY_METRICS_EXPORTER}
2829 - TELEMETRY_TRACES_EXPORTER=${TELEMETRY_TRACES_EXPORTER}
@@ -40,6 +41,7 @@ services:
4041 - REDIS_PASSWORD=${REDIS_PASSWORD}
4142 - REDIS_HOST=${REDIS_HOST}
4243 - REDIS_PORT=${REDIS_PORT}
44+ - REDIS_USERNAME=""
4345 - NETBOX_DIODE_PLUGIN_API_BASE_URL=${NETBOX_DIODE_PLUGIN_API_BASE_URL}
4446 - NETBOX_DIODE_PLUGIN_SKIP_TLS_VERIFY=${NETBOX_DIODE_PLUGIN_SKIP_TLS_VERIFY}
4547 - LOGGING_LEVEL=${LOGGING_LEVEL}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ DIODE_NGINX_PORT=8080
22REDIS_PASSWORD = <PLACEHOLDER_SECRET>
33REDIS_HOST = redis
44REDIS_PORT = 6378
5+ REDIS_USERNAME = " "
56NETBOX_DIODE_PLUGIN_API_BASE_URL = <http://NETBOX_HOST>/api/plugins/diode
67NETBOX_DIODE_PLUGIN_SKIP_TLS_VERIFY = false
78LOGGING_LEVEL = DEBUG
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ func setupEnv(redisAddr string) {
4545 _ = os .Setenv ("GRPC_PORT" , grpcPort )
4646 _ = os .Setenv ("REDIS_HOST" , host )
4747 _ = os .Setenv ("REDIS_PORT" , port )
48+ _ = os .Setenv ("REDIS_USERNAME" , "" )
4849 _ = os .Setenv ("REDIS_PASSWORD" , "" )
4950 _ = os .Setenv ("REDIS_DB" , "0" )
5051 _ = os .Setenv ("REDIS_STREAM_DB" , "1" )
@@ -59,6 +60,7 @@ func teardownEnv() {
5960 _ = os .Unsetenv ("GRPC_PORT" )
6061 _ = os .Unsetenv ("REDIS_HOST" )
6162 _ = os .Unsetenv ("REDIS_PORT" )
63+ _ = os .Unsetenv ("REDIS_USERNAME" )
6264 _ = os .Unsetenv ("REDIS_PASSWORD" )
6365 _ = os .Unsetenv ("REDIS_DB" )
6466 _ = os .Unsetenv ("REDIS_STREAM_DB" )
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ func setupEnv(redisAddr string) {
2626 _ = os .Setenv ("GRPC_PORT" , grpcPort )
2727 _ = os .Setenv ("REDIS_HOST" , host )
2828 _ = os .Setenv ("REDIS_PORT" , port )
29+ _ = os .Setenv ("REDIS_USERNAME" , "" )
2930 _ = os .Setenv ("REDIS_PASSWORD" , "" )
3031 _ = os .Setenv ("REDIS_DB" , "0" )
3132 _ = os .Setenv ("REDIS_STREAM_DB" , "1" )
@@ -49,6 +50,7 @@ func teardownEnv() {
4950 _ = os .Unsetenv ("GRPC_PORT" )
5051 _ = os .Unsetenv ("REDIS_HOST" )
5152 _ = os .Unsetenv ("REDIS_PORT" )
53+ _ = os .Unsetenv ("REDIS_USERNAME" )
5254 _ = os .Unsetenv ("REDIS_PASSWORD" )
5355 _ = os .Unsetenv ("REDIS_DB" )
5456 _ = os .Unsetenv ("REDIS_STREAM_DB" )
You can’t perform that action at this time.
0 commit comments