Skip to content

Commit

Permalink
update URL scheme handling in case of http2 mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit864 committed Jan 20, 2025
1 parent 1f813b9 commit f360561
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions paasta_tools/cli/cmds/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
)

# modes that depend on smartstack port cannot be tested via paasta proxies, so we exclude those
TESTABLE_SERVICE_MODES = {"http", "https", "http2"}
TESTABLE_SERVICE_MODES = {"http", "https"}


def add_subparser(subparsers):
Expand Down Expand Up @@ -78,8 +78,9 @@ def get_smartstack_endpoints(service, soa_dir):
service, full_name=False, soa_dir=soa_dir
):
mode = config.get("mode", "http")
url_scheme = "http" if mode in ["http", "http2"] else mode
port = config.get("proxy_port")
endpoints.append(f"{mode}://169.254.255.254:{port} ({name})")
endpoints.append(f"{url_scheme}://169.254.255.254:{port} ({name})")
return endpoints


Expand All @@ -96,10 +97,12 @@ def get_deployments_strings(service: str, soa_dir: str) -> List[str]:
service=service, namespace="main", soa_dir=soa_dir
)
service_mode = service_config.get_mode()
url_scheme = "http" if service_mode == "http2" else service_mode

for cluster in deployments_to_clusters(deployments):
if service_mode in TESTABLE_SERVICE_MODES:
link = PaastaColors.cyan(
f"{service_mode}://{service}.proxy.{cluster}.paasta/"
f"{url_scheme}://{service}.proxy.{cluster}.paasta/"
)
else:
link = "N/A"
Expand Down

0 comments on commit f360561

Please sign in to comment.