Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated mode: http2 support #4004

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions paasta_tools/cli/cmds/info.py
Original file line number Diff line number Diff line change
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 == "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
2 changes: 2 additions & 0 deletions paasta_tools/cli/schemas/smartstack_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"enum": [
"http",
"https",
"http2",
"tcp"
]
},
Expand Down Expand Up @@ -117,6 +118,7 @@
"enum": [
"http",
"https",
"http2",
"tcp"
]
},
Expand Down
11 changes: 7 additions & 4 deletions paasta_tools/long_running_service_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ def get_healthcheck_mode(self) -> str:
"""
healthcheck_mode = self.get("healthcheck_mode", None)
if not healthcheck_mode:
return self.get_mode()
else:
return healthcheck_mode
mode = self.get_mode()
if mode == "http2":
healthcheck_mode = "http"
else:
healthcheck_mode = mode
return healthcheck_mode

def get_mode(self) -> str:
"""Get the mode that the service runs in and check that we support it.
Expand All @@ -110,7 +113,7 @@ def get_mode(self) -> str:
return None
else:
return "http"
elif mode in ["http", "tcp", "https"]:
elif mode in ["http", "http2", "tcp", "https"]:
return mode
else:
raise InvalidSmartstackMode("Unknown mode: %s" % mode)
Expand Down