Skip to content

Commit

Permalink
Merge pull request Kuadrant#448 from pehala/kubernetes_exposer
Browse files Browse the repository at this point in the history
Add Kubernetes exposer
  • Loading branch information
Jakub Smolar authored Jun 19, 2024
2 parents dee3102 + ca19e65 commit d236912
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions testsuite/config/exposer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Translates string to an Exposer class that can initialized"""

from testsuite.gateway.exposers import OpenShiftExposer, KindExposer
from testsuite.gateway.exposers import OpenShiftExposer, LoadBalancerServiceExposer

EXPOSERS = {"openshift": OpenShiftExposer, "kind": KindExposer}
EXPOSERS = {"openshift": OpenShiftExposer, "kind": LoadBalancerServiceExposer, "kubernetes": LoadBalancerServiceExposer}


# pylint: disable=unused-argument
Expand Down
4 changes: 2 additions & 2 deletions testsuite/gateway/exposers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def hostname(self):
return self._hostname


class KindExposer(Exposer):
"""Exposer using loadbalancer service for Gateway"""
class LoadBalancerServiceExposer(Exposer):
"""Exposer using Load Balancer service for Gateway"""

def expose_hostname(self, name, gateway: Gateway) -> Hostname:
return StaticLocalHostname(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.gateway.exposers import KindExposer
from testsuite.gateway.exposers import LoadBalancerServiceExposer
from testsuite.policy.authorization import Value, JsonResponse
from testsuite.httpx import KuadrantClient
from testsuite.policy.authorization.auth_config import AuthConfig
Expand All @@ -29,7 +29,7 @@ def client(authorino_route):
@pytest.fixture(scope="module")
def authorino_route(request, exposer, authorino, blame, openshift):
"""Add route for authorino http port to be able to access it."""
if isinstance(exposer, KindExposer):
if isinstance(exposer, LoadBalancerServiceExposer):
pytest.skip("raw_http is not available on Kind")

route = OpenshiftRoute.create_instance(
Expand Down
4 changes: 2 additions & 2 deletions testsuite/tests/kuadrant/authorino/operator/tls/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testsuite.openshift import Selector
from testsuite.gateway import Exposer
from testsuite.gateway.envoy.tls import TLSEnvoy
from testsuite.gateway.exposers import KindExposer, OpenShiftExposer
from testsuite.gateway.exposers import LoadBalancerServiceExposer, OpenShiftExposer
from testsuite.openshift.secret import TLSSecret
from testsuite.utils import cert_builder

Expand Down Expand Up @@ -183,7 +183,7 @@ def gateway(
@pytest.fixture(scope="module")
def exposer(request, testconfig, hub_openshift) -> Exposer:
"""Exposer object instance with TLS passthrough"""
if testconfig["default_exposer"] == KindExposer:
if testconfig["default_exposer"] == LoadBalancerServiceExposer:
pytest.skip("TLS tests do not work on Kind")
exposer = OpenShiftExposer(hub_openshift)
request.addfinalizer(exposer.delete)
Expand Down

0 comments on commit d236912

Please sign in to comment.