Skip to content

Commit

Permalink
Merge pull request #138 from harness/OPS-31399_update_tsdb_uri
Browse files Browse the repository at this point in the history
feat: [OPS-31399]: Added capability for database to be overriden
  • Loading branch information
manishjaiswal2 authored Nov 5, 2024
2 parents 8f040cf + 70e5390 commit a25015e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.66
version: 1.3.67

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 2 additions & 1 deletion src/common/templates/_databaseconnectionsv2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ USAGE:
{{ include "harnesscommon.dbconnectionv2.timescaleConnection" (dict "database" "foo" "args" "bar" "context" $ "addSSLModeArg" false) }}
*/}}
{{- define "harnesscommon.dbconnectionv2.timescaleConnection" }}
{{- $database := default .database .context.Values.timescaledb.database }}
{{- $addSSLModeArg := default false .addSSLModeArg }}
{{- $sslEnabled := false }}
{{- $sslEnabledVar := (include "harnesscommon.precedence.getValueFromKey" (dict "ctx" .context "valueType" "bool" "keys" (list ".Values.global.database.timescaledb.sslEnabled" ".Values.timescaledb.sslEnabled"))) }}
Expand All @@ -152,7 +153,7 @@ USAGE:
{{- if and (.userVariableName) (.passwordVariableName) }}
{{- $userAndPassField = (printf "$(%s):$(%s)@" .userVariableName .passwordVariableName) }}
{{- end }}
{{- $connectionString = (printf "%s%s%s:%s/%s" $protocol $userAndPassField $host $port .database) }}
{{- $connectionString = (printf "%s%s%s:%s/%s" $protocol $userAndPassField $host $port $database) }}
{{- if .args }}
{{- if $addSSLModeArg }}
{{- if $sslEnabled }}
Expand Down
3 changes: 2 additions & 1 deletion src/common/templates/_dbv3.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ USAGE:
{{- if .localTimescaleDBCtx }}
{{- $localTimescaleDBCtx = .localTimescaleDBCtx }}
{{- end }}
{{- $database := default .database $localTimescaleDBCtx.database }}
{{- $host := include "harnesscommon.dbconnectionv3.timescaleHost" (dict "context" .context "localTimescaleDBCtx" $localTimescaleDBCtx ) }}
{{- $port := include "harnesscommon.dbconnectionv3.timescalePort" (dict "context" .context "localTimescaleDBCtx" $localTimescaleDBCtx ) }}
{{- $connectionString := "" }}
Expand All @@ -717,7 +718,7 @@ USAGE:
{{- if and (.userVariableName) (.passwordVariableName) }}
{{- $userAndPassField = (printf "$(%s):$(%s)@" .userVariableName .passwordVariableName) }}
{{- end }}
{{- $connectionString = (printf "%s%s%s:%s/%s" $protocol $userAndPassField $host $port .database) }}
{{- $connectionString = (printf "%s%s%s:%s/%s" $protocol $userAndPassField $host $port $database) }}
{{- if .args }}
{{- if $addSSLModeArg }}
{{- if $sslEnabled }}
Expand Down

0 comments on commit a25015e

Please sign in to comment.