Skip to content

Commit

Permalink
Merge branch 'main' into annotate-migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-chdhry authored Sep 16, 2024
2 parents 0b61224 + 8547c45 commit e8255c9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
set -e
make tests
- name: Upload Report to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.out
fail_ci_if_error: true
Expand Down
2 changes: 2 additions & 0 deletions charts/reports-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ helm install reports-server --namespace reports-server --create-namespace report
| config.db.secretName | string | `""` | If set, database connection information will be read from the Secret with this name. Overrides `db.host`, `db.name`, `db.user`, and `db.password`. |
| config.db.host | string | `""` | Database host |
| config.db.hostSecretKeyName | string | `"host"` | The database host will be read from this `key` in the specified Secret, when `db.secretName` is set. |
| config.db.port | int | `5432` | Database port |
| config.db.portSecretKeyName | string | `"port"` | The database port will be read from this `key` in the specified Secret, when `db.secretName` is set. |
| config.db.name | string | `"reportsdb"` | Database name |
| config.db.dbNameSecretKeyName | string | `"dbname"` | The database name will be read from this `key` in the specified Secret, when `db.secretName` is set. |
| config.db.user | string | `"postgres"` | Database user |
Expand Down
8 changes: 8 additions & 0 deletions charts/reports-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Database config is injected into the environment, if a secret ref is set. Otherw
{{- end }}
{{- end }}

{{- define "reports-server.dbPort" -}}
{{- if .Values.config.db.secretName }}
{{- printf "%s" "$(DB_PORT)" }}
{{- else }}
{{- .Values.config.db.port }}
{{- end }}
{{- end }}

{{- define "reports-server.dbName" -}}
{{- if .Values.config.db.secretName }}
{{- printf "%s" "$(DB_DATABASE)" }}
Expand Down
8 changes: 7 additions & 1 deletion charts/reports-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ spec:
- --debug
{{- else }}
- --dbhost={{ include "reports-server.dbHost" . }}
- --dbname={{ include "reports-server.dbName" . }}
- --dbport={{ include "reports-server.dbPort" . }}
- --dbuser={{ include "reports-server.dbUser" . }}
- --dbpassword={{ include "reports-server.dbPassword" . }}
- --dbname={{ include "reports-server.dbName" . }}
- --dbsslmode={{ .Values.config.db.sslmode }}
- --dbsslrootcert={{ .Values.config.db.sslrootcert }}
- --dbsslkey={{ .Values.config.db.sslkey }}
Expand All @@ -61,6 +62,11 @@ spec:
secretKeyRef:
key: {{ .Values.config.db.hostSecretKeyName }}
name: {{ .Values.config.db.secretName }}
- name: DB_PORT
valueFrom:
secretKeyRef:
key: {{ .Values.config.db.portSecretKeyName }}
name: {{ .Values.config.db.secretName }}
- name: DB_DATABASE
valueFrom:
secretKeyRef:
Expand Down
5 changes: 5 additions & 0 deletions charts/reports-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ config:
# -- The database host will be read from this `key` in the specified Secret, when `db.secretName` is set.
hostSecretKeyName: "host"

# -- Database port
port: 5432
# -- The database port will be read from this `key` in the specified Secret, when `db.secretName` is set.
portSecretKeyName: "port"

# -- Database name
name: reportsdb
# -- The database name will be read from this `key` in the specified Secret, when `db.secretName` is set.
Expand Down
3 changes: 2 additions & 1 deletion config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ spec:
- name: reports-server
args:
- --dbhost=reports-server-postgresql.reports-server
- --dbname=reportsdb
- --dbport=5432
- --dbuser=postgres
- --dbpassword=reports
- --dbname=reportsdb
- --dbsslmode=disable
- --dbsslrootcert=
- --dbsslkey=
Expand Down

0 comments on commit e8255c9

Please sign in to comment.