Skip to content

Commit

Permalink
fix: [PL-57361]: support multipe ingress definitions (#131)
Browse files Browse the repository at this point in the history
* fix: [PL-57361]: support multipe ingress definitions

* fix: [PL-57361]: bump chart version
  • Loading branch information
sean-harness authored Oct 16, 2024
1 parent 69de8d1 commit bd1963b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.61
version: 1.3.62

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
14 changes: 10 additions & 4 deletions src/common/templates/_ingress.tpl
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{{/*
USAGE:
{{- include "harnesscommon.v1.renderIngress" (dict "ctx" $) }}
or
{{- include "harnesscommon.v1.renderIngress" (dict "ingress" .Values.other.ingress "ctx" $) }}
*/}}
{{- define "harnesscommon.v1.renderIngress" }}
{{- $ := .ctx }}
{{- $ingress := $.Values.ingress }}
{{- if .ingress -}}
{{- $ingress = .ingress }}
{{- end }}
{{- if $.Values.global.ingress.enabled -}}
{{- range $index, $object := $.Values.ingress.objects }}
{{- range $index, $object := $ingress.objects }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ dig "name" ((cat (default $.Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-") "-" $index)| nospace) $object }}
name: {{ dig "name" ((cat (coalesce $ingress.name $.Values.nameOverride $.Chart.Name | trunc 63 | trimSuffix "-") "-" $index) | nospace) $object }}
namespace: {{ $.Release.Namespace }}
{{- if $.Values.global.commonLabels }}
labels:
{{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- include "harnesscommon.tplvalues.render" (dict "value" $object.annotations "context" $) | nindent 4 }}
{{- if $.Values.ingress.annotations }}
{{- include "harnesscommon.tplvalues.render" (dict "value" $.Values.ingress.annotations "context" $) | nindent 4 }}
{{- if $ingress.annotations }}
{{- include "harnesscommon.tplvalues.render" (dict "value" $ingress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.global.commonAnnotations }}
{{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonAnnotations "context" $ ) | nindent 4 }}
Expand Down

0 comments on commit bd1963b

Please sign in to comment.