Skip to content

Commit

Permalink
feat: add ingressClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
lenglet-k authored and eshepelyuk committed Nov 24, 2023
1 parent 49766ad commit 44023f5
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ metadata:
{{- . | toYaml | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ $ing.ingressClassName }}
{{- if $ing.tls }}
tls:
- hosts:
Expand Down
21 changes: 21 additions & 0 deletions test/lint/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,24 @@ tests:
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- registry.extraVolumeMounts: Invalid type. Expected: array, given: string
- it: ingress is not object
set:
registry:
ingress: "qwe"
asserts:
- failedTemplate:
errorMessage: |
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- registry.ingress: Invalid type. Expected: object, given: string
- it: ingressClassName is not string
set:
registry:
ingress:
ingressClassName: 1
asserts:
- failedTemplate:
errorMessage: |
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- registry.ingress.ingressClassName: Invalid type. Expected: string, given: integer
38 changes: 38 additions & 0 deletions test/unit/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
suite: test ingress
templates:
- ingress.yaml
tests:
- it: registry and ingress enabled
set:
registry.enabled: true
registry.ingress.enabled: true
asserts:
- isKind:
of: Ingress
- it: ingress
set:
registry.enabled: true
registry:
ingress:
enabled: true
ingressClassName: nginx
host: "apicurio.local"
path: "/"
asserts:
- exists:
path: spec.ingressClassName
- equal:
path: spec.ingressClassName
value: nginx
- exists:
path: spec.rules[0].host
- equal:
path: spec.rules[0].host
value: apicurio.local
- exists:
path: spec.rules[0].http.paths[0].path
- equal:
path: spec.rules[0].http.paths[0].path
value: /


1 change: 1 addition & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"required": ["enabled", "host", "path"],
"properties": {
"enabled": {"type": "boolean", "default": false, "title": "enable ingress resource"},
"ingressClassName": {"type": "string", "default": "", "title": "set ingress controller used for this ingress rule"},
"host": {"type": "string", "default": "apicurio.local", "title": "hostname"},
"path": {"type": "string", "default": "/", "title": "ingress path"},
"tls": {"type": "boolean", "default": false, "title": "enable TLS for ingress host",
Expand Down
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ registry:

ingress:
enabled: false
ingressClassName: ""
host: "apicurio.local"
path: "/"
tls: false
Expand Down

0 comments on commit 44023f5

Please sign in to comment.