diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7b5cfa8..c4e881b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -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 diff --git a/deploy_config_generator/output/kube_ingress.py b/deploy_config_generator/output/kube_ingress.py index b4c2d64..aa420c0 100644 --- a/deploy_config_generator/output/kube_ingress.py +++ b/deploy_config_generator/output/kube_ingress.py @@ -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', diff --git a/docs/plugin_kube_ingress.md b/docs/plugin_kube_ingress.md index 4a59177..8c50fd5 100644 --- a/docs/plugin_kube_ingress.md +++ b/docs/plugin_kube_ingress.md @@ -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|| diff --git a/tests/integration/kube_basic/deploy/config.yml b/tests/integration/kube_basic/deploy/config.yml index f5730d4..992b3e6 100644 --- a/tests/integration/kube_basic/deploy/config.yml +++ b/tests/integration/kube_basic/deploy/config.yml @@ -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: diff --git a/tests/integration/kube_basic/expected_output/kube_ingress-002-test-ingress-with-class-name.yaml b/tests/integration/kube_basic/expected_output/kube_ingress-002-test-ingress-with-class-name.yaml new file mode 100644 index 0000000..9c35ddf --- /dev/null +++ b/tests/integration/kube_basic/expected_output/kube_ingress-002-test-ingress-with-class-name.yaml @@ -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 diff --git a/tox.ini b/tox.ini index 3c7d2fc..2e8f7e5 100644 --- a/tox.ini +++ b/tox.ini @@ -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]