Skip to content

Commit

Permalink
fix: assertoor double ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed Aug 8, 2024
1 parent 741d7ff commit 8678282
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/assertoor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ home: https://github.com/ethpandaops/assertoor
sources:
- https://github.com/ethpandaops/assertoor
type: application
version: 0.0.2
version: 0.0.3
appVersion: "1.0.0"
maintainers:
- name: pk910
Expand Down
4 changes: 3 additions & 1 deletion charts/assertoor/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# assertoor

![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Testing tool that is capable of doing actions and checking conditions on ethereum pos networks.

Expand Down Expand Up @@ -77,6 +77,8 @@ assertoorTests:
| ingress.enabled | bool | `false` | Ingress resource for the HTTP API |
| ingress.hosts[0].host | string | `"chart-example.local"` | |
| ingress.hosts[0].paths | list | `[]` | |
| ingress.hosts[1].host | string | `"chart-example-admin.local"` | |
| ingress.hosts[1].paths | list | `[]` | |
| ingress.tls | list | `[]` | Ingress TLS |
| initContainers | list | `[]` | Additional init containers |
| nameOverride | string | `""` | Overrides the chart's name |
Expand Down
29 changes: 26 additions & 3 deletions charts/assertoor/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "assertoor.fullname" . -}}
{{- $svcPort := include "assertoor.httpPort" . -}}
{{- $svcPortAdmin := include "assertoor.httpPort" . -}}
{{- $svcPortPublic := include "assertoor.publicHttpPort" . -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down Expand Up @@ -38,6 +39,7 @@ spec:
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- if and (contains "admin" .host) (semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion) }}
- host: {{ .host | quote }}
http:
paths:
Expand All @@ -51,11 +53,32 @@ spec:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
number: {{ $svcPortAdmin }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
servicePort: {{ $svcPortAdmin }}
{{- end }}
{{- end }}
{{- else }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPortPublic }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPortPublic }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/assertoor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ ingress:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# -- Ingress host
# -- if you set "admin" in the hostname it will use the admin service (8080)
# -- if you do not set admin in the hostname it will use the public service (8082)
hosts:
- host: chart-example.local
paths: []
- host: chart-example-admin.local
paths: []
# -- Ingress TLS
tls: []
# - secretName: chart-example-tls
Expand Down

0 comments on commit 8678282

Please sign in to comment.