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

fix(charts): fix default dependency service #800

Merged
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
14 changes: 14 additions & 0 deletions charts/bpdm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

### Changed

- update BPDM Pool Chart to version 6.0.2
- update BPDM Gate Chart to version 5.0.2
- update BPDM Orchestrator Chart to version 2.0.2
- update BPDM Cleaning Service Dummy Chart to version 2.0.2
- update BPDM Bridge Chart to version 2.0.2

### Removed

- postgres fullNameOverride

## [4.0.1] - 2024-02-23

### Changed

- update BPDM Pool Chart to version 6.0.1
- update BPDM Gate Chart to version 5.0.1
- update BPDM Orchestrator Chart to version 2.0.1
Expand Down
12 changes: 6 additions & 6 deletions charts/bpdm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
name: bpdm
type: application
description: A Helm chart for Kubernetes that deploys the BPDM applications
version: 4.0.1
version: 4.0.2
appVersion: "5.0.0"
home: https://github.com/eclipse-tractusx/bpdm
sources:
Expand All @@ -33,23 +33,23 @@ maintainers:

dependencies:
- name: bpdm-gate
version: 5.0.1
version: 5.0.2
alias: bpdm-gate
condition: bpdm-gate.enabled
- name: bpdm-pool
version: 6.0.1
version: 6.0.2
alias: bpdm-pool
condition: bpdm-pool.enabled
- name: bpdm-bridge-dummy
version: 2.0.1
version: 2.0.2
alias: bpdm-bridge-dummy
condition: bpdm-bridge-dummy.enabled
- name: bpdm-cleaning-service-dummy
version: 2.0.1
version: 2.0.2
alias: bpdm-cleaning-service-dummy
condition: bpdm-cleaning-service-dummy.enabled
- name: bpdm-orchestrator
version: 2.0.1
version: 2.0.2
alias: bpdm-orchestrator
condition: bpdm-orchestrator.enabled
- name: postgresql
Expand Down
6 changes: 6 additions & 0 deletions charts/bpdm/charts/bpdm-bridge-dummy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [2.0.2] - 2024-03-01

### Changed

- default dependency service names

## [2.0.1] - 2024-02-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/bpdm/charts/bpdm-bridge-dummy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-bridge-dummy
appVersion: "5.0.0"
version: 2.0.1
version: 2.0.2
description: A Helm chart for deploying the BPDM bridge dummy service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand Down
40 changes: 0 additions & 40 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,46 +61,6 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "bpdm-bridge.poolServiceName" -}}
{{- $config := .Values.applicationConfig -}}
{{- if and $config (not (empty $config.bpdm)) -}}
{{- $bpdm := $config.bpdm -}}
{{- if and $bpdm (not (empty $bpdm.pool)) -}}
{{- $pool := $bpdm.pool -}}
{{- if and $pool (not (empty (index $pool "base-url"))) -}}
{{- index $pool "base-url" -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- end }}

{{- define "bpdm-bridge.gateServiceName" -}}
{{- $config := .Values.applicationConfig -}}
{{- if and $config (not (empty $config.bpdm)) -}}
{{- $bpdm := $config.bpdm -}}
{{- if and $bpdm (not (empty $bpdm.gate)) -}}
{{- $gate := $bpdm.gate -}}
{{- if and $gate (not (empty (index $gate "base-url"))) -}}
{{- index $gate "base-url" -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-gate" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-gate" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-gate" .Release.Name) ":8080" -}}
{{- end -}}
{{- end }}



{{/*
Selector labels
*/}}
Expand Down
4 changes: 2 additions & 2 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ data:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
pool:
base-url: {{include "bpdm-bridge.poolServiceName" .}}
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-pool") }}
gate:
base-url: {{include "bpdm-bridge.gateServiceName" .}}
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-gate") }}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
Expand Down
6 changes: 6 additions & 0 deletions charts/bpdm/charts/bpdm-cleaning-service-dummy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [2.0.2] - 2024-03-01

### Changed

- default dependency service names

## [2.0.1] - 2024-02-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/bpdm/charts/bpdm-cleaning-service-dummy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-cleaning-service-dummy
appVersion: "5.0.0"
version: 2.0.1
version: 2.0.2
description: A Helm chart for deploying the BPDM cleaning service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ Create name of application secret
{{- end }}




{{/*
Invoke include on given definition with postgresql dependency context
Usage: include "includeWithPostgresContext" (list $ "your_include_function_here")
Expand All @@ -109,4 +107,16 @@ Usage: include "includeWithPostgresContext" (list $ "your_include_function_here"
{{- $ := index . 0 }}
{{- $function := index . 1 }}
{{- include $function (dict "Values" $.Values.postgres "Chart" (dict "Name" "postgres") "Release" $.Release) }}
{{- end }}

{{- define "bpdm.toReleaseName" -}}
{{- $top := first . }}
{{- $name := index . 1 }}
{{- if contains $name $top.Release.Name }}
{{- $top.Release.Name | trunc 63 | trimSuffix "-" }}
{{- else if hasPrefix $top.Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $top.Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data:
# which can be overwritten by external.yml
bpdm:
orchestrator:
base-url: {{include "bpdm-cleaning-service-dummy.orchestratorServiceName" .}}
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-orchestrator") }}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
Expand Down
6 changes: 6 additions & 0 deletions charts/bpdm/charts/bpdm-gate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [5.0.2] - 2024-03-01

### Changed

- default dependency service names

## [5.0.1] - 2024-02-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/bpdm/charts/bpdm-gate/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-gate
appVersion: "5.0.0"
version: 5.0.1
version: 5.0.2
description: A Helm chart for deploying the BPDM gate service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand Down
37 changes: 12 additions & 25 deletions charts/bpdm/charts/bpdm-gate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,6 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "bpdm-gate.poolServiceName" -}}
{{- $config := .Values.applicationConfig -}}
{{- if and $config (not (empty $config.bpdm)) -}}
{{- $bpdm := $config.bpdm -}}
{{- if and $bpdm (not (empty $bpdm.pool)) -}}
{{- $pool := $bpdm.pool -}}
{{- if and $pool (not (empty (index $pool "base-url"))) -}}
{{- index $pool "base-url" -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- else -}}
{{- print "http://" (printf "%s-bpdm-pool" .Release.Name) ":8080" -}}
{{- end -}}
{{- end }}







{{/*
Selector labels
*/}}
Expand Down Expand Up @@ -117,4 +92,16 @@ Usage: include "includeWithPostgresContext" (list $ "your_include_function_here"
{{- $ := index . 0 }}
{{- $function := index . 1 }}
{{- include $function (dict "Values" $.Values.postgres "Chart" (dict "Name" "postgres") "Release" $.Release) }}
{{- end }}

{{- define "bpdm.toReleaseName" -}}
{{- $top := first . }}
{{- $name := index . 1 }}
{{- if contains $name $top.Release.Name }}
{{- $top.Release.Name | trunc 63 | trimSuffix "-" }}
{{- else if hasPrefix $top.Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $top.Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/bpdm/charts/bpdm-gate/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ data:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
pool:
base-url: {{include "bpdm-gate.poolServiceName" .}}
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-pool") }}
orchestrator:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-orchestrator") }}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
Expand Down
8 changes: 7 additions & 1 deletion charts/bpdm/charts/bpdm-orchestrator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [5.0.1] - 2024-02-23
## [2.0.2] - 2024-03-01

### Changed

- default dependency service names

## [2.0.1] - 2024-02-23

### Changed

Expand Down
2 changes: 1 addition & 1 deletion charts/bpdm/charts/bpdm-orchestrator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-orchestrator
appVersion: "5.0.0"
version: 2.0.1
version: 2.0.2
description: A Helm chart for deploying the BPDM Orchestrator service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand Down
6 changes: 6 additions & 0 deletions charts/bpdm/charts/bpdm-pool/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [6.0.2] - 2024-03-01

### Changed

- default dependency service names

## [6.0.1] - 2024-02-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/bpdm/charts/bpdm-pool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-pool
appVersion: "5.0.0"
version: 6.0.1
version: 6.0.2
description: A Helm chart for deploying the BPDM pool service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand Down
25 changes: 10 additions & 15 deletions charts/bpdm/charts/bpdm-pool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,14 @@ Usage: include "includeWithPostgresContext" (list $ "your_include_function_here"
{{- include $function (dict "Values" $.Values.postgres "Chart" (dict "Name" "postgres") "Release" $.Release) }}
{{- end }}

{{/*
Determine opensearch service/host name to connect to
*/}}
{{- define "bpdm.opensearchDependency" -}}
{{- include "includeWithOpensearchContext" (list $ "opensearch.masterService") }}
{{- end }}}

{{/*
Invoke include on given definition with opensearch dependency context
Usage: include "includeWithOpensearchContext" (list root "your_include_function_here")
*/}}
{{- define "includeWithOpensearchContext" -}}
{{- $ := index . 0 }}
{{- $function := index . 1 }}
{{- include $function (dict "Values" $.Values.opensearch "Chart" (dict "Name" "opensearch") "Release" $.Release) }}
{{- define "bpdm.toReleaseName" -}}
{{- $top := first . }}
{{- $name := index . 1 }}
{{- if contains $name $top.Release.Name }}
{{- $top.Release.Name | trunc 63 | trimSuffix "-" }}
{{- else if hasPrefix $top.Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $top.Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/bpdm/charts/bpdm-pool/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ data:
bpdm:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
client:
orchestrator:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-orchestrator") }}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
Expand Down
7 changes: 3 additions & 4 deletions charts/bpdm/charts/bpdm-pool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ applicationConfig:
# host: ...

applicationSecrets:
spring:
datasource:
# overwrite for security reasons
password: bpdm
# spring:
# datasource:
# password: ...

postgres:
enabled: true
Expand Down
Loading
Loading