Skip to content

Commit

Permalink
Merge pull request Kuadrant#449 from pehala/auto_exposer
Browse files Browse the repository at this point in the history
Automatic exposer detection
  • Loading branch information
pehala authored Jun 20, 2024
2 parents 4f78749 + bbb25fe commit 81edbd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/settings.local.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# auth_url: "" # authorization URL for already deployed Authorino
# oidc_url: "" # oidc URL for already deployed Authorino
# metrics_service_name: "" # controller metrics service name for already deployed Authorino
# default_exposer: "openshift" # Exposer type that should be used, options: 'openshift'
# default_exposer: "kubernetes" # Force Exposer typem options: 'openshift', 'kind', 'kubernetes'
# control_plane:
# managedzone: aws-mz # Name of the ManagedZone resource
# issuer: # Issuer object for testing TLSPolicy
Expand Down
1 change: 0 additions & 1 deletion config/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ default:
hyperfoil:
generate_reports: True
reports_dir: "reports"
default_exposer: "openshift"
control_plane:
managedzone: "aws-mz"
issuer:
Expand Down
10 changes: 7 additions & 3 deletions testsuite/config/exposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
# pylint: disable=unused-argument
def load(obj, env=None, silent=True, key=None, filename=None):
"""Selects proper Exposes class"""
try:
if "default_exposer" not in obj or not obj["default_exposer"]:
client = obj["cluster"]
if "route.openshift.io/v1" in client.do_action("api-versions").out():
obj["default_exposer"] = EXPOSERS["openshift"]
else:
obj["default_exposer"] = EXPOSERS["kubernetes"]
else:
obj["default_exposer"] = EXPOSERS[obj["default_exposer"]]
except KeyError:
pass

0 comments on commit 81edbd5

Please sign in to comment.