Skip to content

Commit

Permalink
feat: add ingressClassName support to Ingress
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <averbic@applause.com>
  • Loading branch information
verbotenj committed Sep 24, 2024
1 parent f397acf commit 27326e2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
Run-CI-Script:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
- uses: actions/checkout@v2
- run: scripts/ci.sh
3 changes: 3 additions & 0 deletions deploy_config_generator/output/kube_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class OutputPlugin(kube_common.OutputPlugin):
type='dict',
fields=copy.deepcopy(INGRESS_BACKEND_FIELD_SPEC),
),
ingress_class_name=dict(
type='str',
),
rules=dict(
type='list',
subtype='dict',
Expand Down
1 change: 1 addition & 0 deletions docs/plugin_kube_ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Name | Type | Required | Default | Description
`spec . default_backend . service . port`|`dict`|no||
`spec . default_backend . service . port . name`|`str`|no||
`spec . default_backend . service . port . number`|`int`|no||
`spec . ingress_class_name`|`str`|no||
`spec . rules`|`list` (of `dict`)|no||
`spec . rules . host`|`str`|no||
`spec . rules . http`|`dict`|no||
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/kube_basic/deploy/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@ kube_ingresses:
name: test
port:
number: 80
- metadata:
name: test-ingress-with-class-name
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingress_class_name: kong
rules:
- http:
paths:
- path: /testpath
path_type: Prefix
backend:
service:
name: test
port:
number: 80

kube_pvcs:
- metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
name: test-ingress-with-class-name
spec:
ingressClassName: kong
rules:
- http:
paths:
- backend:
service:
name: test
port:
number: 80
path: /testpath
pathType: Prefix
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tox]
downloadcache = {toxworkdir}/cache/
envlist = py3
skipsdist = True

[testenv]
deps = flake8
commands =
flake8
python setup.py test
python setup.py integration

[flake8]
Expand Down

0 comments on commit 27326e2

Please sign in to comment.