Skip to content

Commit

Permalink
[devxp-app] ⚡ Add helper for virtual-service
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Luisi committed Jun 17, 2024
1 parent 85b806c commit 23dfe9f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 0 additions & 12 deletions charts/devxp-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ kind: Deployment
{{- end }}


{{- define "vs-hosts" }}
{{- $hosts := list }}
{{- $name := .Values.name }}
{{- $hosts = append $hosts (printf "%s.%s" $name .Values.global.network.domain) }}
{{- if .Values.istio.virtualServices.custom.hosts }}
{{- range $_, $host:= .Values.istio.virtualServices.custom.hosts }}
{{- $hosts = append $hosts ($host) }}
{{- end }}
{{- end }}
{{- $hosts | toYaml }}
{{- end }}




12 changes: 12 additions & 0 deletions charts/devxp-app/templates/istio/_virtual-service.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "vs-hosts" }}
{{- $hosts := list }}
{{- $name := .Values.name }}
{{- $hosts = append $hosts (printf "%s.%s" $name .Values.global.network.domain) }}
{{- if .Values.istio.virtualServices.custom.hosts }}
{{- range $_, $host := .Values.istio.virtualServices.custom.hosts }}
{{- $hosts = append $hosts $host }}
{{- end }}
{{- end }}
{{- $hosts | toYaml | nindent 2 }}
{{- end }}

2 changes: 1 addition & 1 deletion charts/devxp-app/templates/istio/virtual-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
gateways:
- {{ .Values.istio.gateways }}
hosts:
{{- include "vs-hosts" . | nindent 2 }}
{{- include "vs-hosts" . | indent 2 }}
http:
{{- if .Values.argoRollouts.enabled }}
- name: primary
Expand Down
2 changes: 1 addition & 1 deletion charts/devxp-app/values-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ monitoring:
extraPort:
enabled: true
actuator:
enabled: false
enabled: false

0 comments on commit 23dfe9f

Please sign in to comment.