[CPS] Database port made configurable
[oom.git] / kubernetes / cps / components / cps-core / resources / config / application-helm.yml
index 0bc7d5b..e9958f1 100644 (file)
@@ -2,6 +2,7 @@
 #  Copyright (C) 2021 Pantheon.tech
 #  Modifications Copyright (C) 2020 Bell Canada.
 #  Modifications Copyright (C) 2021 Nordix Foundation.
+#  Modifications Copyright (C) 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 
 spring:
   datasource:
-    url: jdbc:postgresql://{{ .Values.postgres.service.name2 }}:5432/{{ .Values.postgres.config.pgDatabase }}
+{{- if .Values.global.postgres.localCluster }}
+    url: jdbc:postgresql://{{ .Values.postgres.service.name2 }}:{{ .Values.postgres.service.externalPort2 }}/{{ .Values.postgres.config.pgDatabase }}
+{{- else }}
+    url: jdbc:postgresql://{{ .Values.global.postgres.service.name2 }}:{{ .Values.global.postgres.service.externalPort2 }}/{{ .Values.postgres.config.pgDatabase }}
+{{- end }}
     username: ${DB_USERNAME}
     password: ${DB_PASSWORD}
     driverClassName: org.postgresql.Driver