diff --git a/charts/cron-job/charts/common-0.5.1.tgz b/charts/cron-job/charts/common-0.5.1.tgz index d02dd1e..3d4dc10 100644 Binary files a/charts/cron-job/charts/common-0.5.1.tgz and b/charts/cron-job/charts/common-0.5.1.tgz differ diff --git a/charts/onechart/charts/common-0.5.1.tgz b/charts/onechart/charts/common-0.5.1.tgz index d02dd1e..8eeca22 100644 Binary files a/charts/onechart/charts/common-0.5.1.tgz and b/charts/onechart/charts/common-0.5.1.tgz differ diff --git a/charts/onechart/templates/ingress.yaml b/charts/onechart/templates/ingress.yaml index 6121414..722813c 100644 --- a/charts/onechart/templates/ingress.yaml +++ b/charts/onechart/templates/ingress.yaml @@ -5,6 +5,9 @@ {{- if .longName }} {{- $resourceName = printf "%s-%s" $robustName (include "robustName" .ingress.host) -}} {{- end }} +{{- $svcPort := .root.Values.svcPort -}} +{{- $containerPort := .root.Values.containerPort -}} + --- apiVersion: networking.k8s.io/v1 kind: Ingress @@ -43,6 +46,7 @@ spec: rules: - host: {{ .ingress.host | quote }} http: + {{- if not .ingress.paths }} paths: - path: {{ .ingress.path | default "/" | quote }} pathType: {{ .ingress.pathType | default "Prefix" | quote }} @@ -50,7 +54,19 @@ spec: service: name: {{ $robustName }} port: - number: {{ if .root.Values.svcPort }}{{ .root.Values.svcPort }}{{ else }}{{ .root.Values.containerPort }}{{ end }} + number: {{ if $svcPort }}{{ $svcPort }}{{ else }}{{ $containerPort }}{{ end }} + {{- else }} + paths: + {{- range .ingress.paths }} + - path: {{ .path | quote }} + pathType: {{ .pathType | default "Prefix" | quote }} + backend: + service: + name: {{ $robustName }} + port: + number: {{ if $svcPort }}{{ $svcPort }}{{ else }}{{ $containerPort }}{{ end }} + {{- end }} + {{- end }} {{- end }} {{- with .Values.ingress }} diff --git a/charts/onechart/tests/ingress_multipath_test.yaml b/charts/onechart/tests/ingress_multipath_test.yaml new file mode 100644 index 0000000..647611e --- /dev/null +++ b/charts/onechart/tests/ingress_multipath_test.yaml @@ -0,0 +1,26 @@ +suite: test ingress +templates: + - ingress.yaml +tests: + - it: Should default + set: + ingress: + host: chart-example.local + asserts: + - equal: + path: spec.rules[0].http.paths[0].path + value: "/" + - it: Should use paths + set: + ingress: + host: chart-example.local + paths: + - path: /mypath + - path: /mypath2 + asserts: + - equal: + path: spec.rules[0].http.paths[0].path + value: "/mypath" + - equal: + path: spec.rules[0].http.paths[1].path + value: "/mypath2"