diff --git a/library/common-test/tests/ingress/traefik_test.yaml b/library/common-test/tests/ingress/traefik_test.yaml index bfe77af6..d3b0bb03 100644 --- a/library/common-test/tests/ingress/traefik_test.yaml +++ b/library/common-test/tests/ingress/traefik_test.yaml @@ -265,71 +265,6 @@ tests: value: traefik.ingress.kubernetes.io/router.entrypoints: websecure - - it: should set correct namespace when ingressClassName is defined - set: - service: *service - operator: *operator - global: *global - ingress: - my-ingress: - enabled: true - primary: true - integrations: - traefik: - enabled: true - ingressClassName: some-class - hosts: *hosts - asserts: - - documentIndex: *ingressDoc - isKind: - of: Ingress - - documentIndex: *ingressDoc - equal: - path: metadata.name - value: test-release-name-common-test - - documentIndex: *ingressDoc - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - traefik.ingress.kubernetes.io/router.middlewares: chain-basic-some-class@kubernetescrd - - - it: should set correct namespace when ingressClassName is defined in SCALE - set: - service: *service - operator: *operator - global: - ixChartContext: - imNotEmpty: true - traefik: - fixedMiddlewares: - - name: chain-basic - namespace: some-namespace - namespace: ix-namespace - ingress: - my-ingress: - enabled: true - primary: true - integrations: - traefik: - enabled: true - ingressClassName: some-class - hosts: *hosts - asserts: - - documentIndex: *ingressDoc - isKind: - of: Ingress - - documentIndex: *ingressDoc - equal: - path: metadata.name - value: test-release-name-common-test - - documentIndex: *ingressDoc - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - traefik.ingress.kubernetes.io/router.middlewares: chain-basic-ix-some-class@kubernetescrd - - it: should add the defined middlewares to the ingress set: operator: *operator diff --git a/library/common/templates/lib/ingress/integrations/_traefik.tpl b/library/common/templates/lib/ingress/integrations/_traefik.tpl index ed4d2eca..e61bddbc 100644 --- a/library/common/templates/lib/ingress/integrations/_traefik.tpl +++ b/library/common/templates/lib/ingress/integrations/_traefik.tpl @@ -122,18 +122,6 @@ {{- fail (printf "Ingress - Could not determine namespace for middleware [%s]. Make sure middleware is created or explicitly specify [namespace]" $mid.name) -}} {{- end -}} - {{/* TODO: FIXME: Fix this hack - If ingressClassName is set, use that as namespace - */}} - {{- if $traefik.ingressClassName -}} - {{- $midNamespace = tpl $traefik.ingressClassName $rootCtx -}} - - {{/* On SCALE prepend with ix- */}} - {{- if $rootCtx.Values.global.ixChartContext -}} - {{- $midNamespace = (printf "ix-%s" $midNamespace) -}} - {{- end -}} - {{- end -}} - {{/* Format middleware */}} {{- $formattedMiddlewares = mustAppend $formattedMiddlewares (printf "%s-%s@kubernetescrd" $mid.name $midNamespace) -}} {{- end -}}