Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm/snippet-service: remove configuration for unsupported cqlDB #1342

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions charts/plgd-hub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ tls:
useSystemCAPool: {{ $http.tls.useSystemCAPool }}
{{- end }}

{{- define "plgd-hub.authorizationFilterEndpoints" }}
{{- $ := index . 0 }}
{{- $endpoints := index . 1 }}
{{- $result := list}}
{{- range $endpoints }}
{{- $authority := include "plgd-hub.resolveTemplateString" (list $ .authority) }}
{{- if $authority }}
{{- $result = append $result . }}
{{- end }}
{{- end }}
{{- dict "Values" $result | toYaml }}
{{- end }}

{{- define "plgd-hub.basicAuthorizationConfig" }}
{{- $ := index . 0 }}
{{- $authorization := index . 1 }}
Expand All @@ -193,13 +206,14 @@ tls:
{{- if eq (len $endpoints) 0 }}
{{- $endpoints = $.Values.global.authorization.endpoints }}
{{- end }}
{{- if eq (len $endpoints) 0 }}
{{- fail (printf "%s.authorization.endpoints or global.authorization.endpoints is required" $prefix) }}
{{- $mapEndpoints := include "plgd-hub.authorizationFilterEndpoints" (list $ $endpoints) | fromYaml }}
{{- if eq (len $mapEndpoints.Values) 0 }}
{{- fail (printf "%s.endpoints or global.authorization.endpoints is required" $prefix) }}
{{- end}}
{{- if not $.Values.mockoauthserver.enabled }}
audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }}
audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }}
endpoints:
{{- range $endpoints }}
{{- range $mapEndpoints.Values }}
{{- $authority := include "plgd-hub.resolveTemplateString" (list $ .authority) }}
{{- if $authority }}
- authority: {{ include "plgd-hub.resolveTemplateString" (list $ .authority) }}
Expand All @@ -208,9 +222,9 @@ tls:
{{- end }}
{{- end }}
{{- else }}
audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }}
audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }}
endpoints:
{{- range $endpoints }}
{{- range $mapEndpoints.Values }}
{{- $authority := include "plgd-hub.resolveTemplateString" (list $ .authority) }}
{{- if not $authority }}
{{- $authority = include "plgd-hub.mockoauthserver.uri" $ }}
Expand Down
21 changes: 0 additions & 21 deletions charts/plgd-hub/templates/snippet-service/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,6 @@ data:
{{- $mongoDbTls := .clients.storage.mongoDB.tls }}
{{- include "plgd-hub.certificateConfig" (list $ $mongoDbTls $cert ) | indent 10 }}
useSystemCAPool: {{ .clients.storage.mongoDB.tls.useSystemCAPool }}
cqlDB:
hosts:
{{- include "plgd-hub.cqlDBHosts" (list $ .clients.storage.cqlDB.hosts ) | indent 8 }}
port: {{ .clients.storage.cqlDB.port | default 9142 }}
table: {{ .clients.storage.cqlDB.table | quote }}
numConnections: {{ .clients.storage.cqlDB.numConnections }}
connectTimeout: {{ .clients.storage.cqlDB.connectTimeout }}
useHostnameResolution: {{ .clients.storage.cqlDB.useHostnameResolution }}
reconnectionPolicy:
constant:
interval: {{ .clients.storage.cqlDB.reconnectionPolicy.constant.interval }}
maxRetries: {{ .clients.storage.cqlDB.reconnectionPolicy.constant.maxRetries }}
keyspace:
name: {{ .clients.storage.cqlDB.keyspace.name }}
create: {{ .clients.storage.cqlDB.keyspace.create }}
replication:
{{- toYaml .clients.storage.cqlDB.keyspace.replication | nindent 14 }}
tls:
{{- $cqlDbTls := .clients.storage.cqlDB.tls }}
{{- include "plgd-hub.certificateConfig" (list $ $cqlDbTls $cert ) | indent 10 }}
useSystemCAPool: {{ .clients.storage.cqlDB.tls.useSystemCAPool }}
resourceUpdater:
cleanUpExpiredUpdates: {{ .clients.resourceUpdater.cleanUpExpiredUpdates | quote }}
grpc:
Expand Down
4 changes: 2 additions & 2 deletions charts/plgd-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ global:
audience: "{{ include \"plgd-hub.globalAudience\" . }}"
endpoints:
# -- Authorization endpoint to Customer OAuth server
- address: "{{ include \"plgd-hub.globalAuthority\" . }}"
- authority: "{{ include \"plgd-hub.globalAuthority\" . }}"
http:
maxIdleConns: 16
maxConnsPerHost: 32
Expand All @@ -41,7 +41,7 @@ global:
keyFile:
certFile:
useSystemCAPool: true
- address: "{{ include \"plgd-hub.m2mOAuthServerAuthority\" . }}"
- authority: "{{ include \"plgd-hub.m2mOAuthServerAuthority\" . }}"
http:
maxIdleConns: 16
maxConnsPerHost: 32
Expand Down
Loading