Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ingressClassName support to Ingress #124

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 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'
- uses: actions/checkout@v2
python-version: '3.10'
- uses: actions/checkout@v4
- 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
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ downloadcache = {toxworkdir}/cache/
envlist = py3

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

[flake8]
Expand Down