-
Notifications
You must be signed in to change notification settings - Fork 241
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ def run_healthcheck_on_container( | |
healthcheck_result = perform_cmd_healthcheck( | ||
docker_client, container_id, healthcheck_data, timeout | ||
) | ||
elif healthcheck_mode == "http" or healthcheck_mode == "https": | ||
elif healthcheck_mode in ["http", "https", "http2"]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking suggestion: might be nice to have a constant for |
||
healthcheck_result = perform_http_healthcheck(healthcheck_data, timeout) | ||
elif healthcheck_mode == "tcp": | ||
healthcheck_result = perform_tcp_healthcheck(healthcheck_data, timeout) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1371,7 +1371,7 @@ def get_liveness_probe( | |
timeout_seconds=timeout_seconds, | ||
) | ||
|
||
if mode == "http" or mode == "https": | ||
if mode in ["http", "https", "http2"]: | ||
path = self.get_healthcheck_uri(service_namespace_config) | ||
probe.http_get = V1HTTPGetAction( | ||
path=path, port=self.get_container_port(), scheme=mode.upper() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am handling this in get_healthcheck_mode func as most of the places we are relying on right conversion of healthcheck_mode so fixing that and making http as default value for http2 service if healthcheck_mode is not defined explicitly will take care of this case. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,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) | ||
|
@@ -424,7 +424,7 @@ def get_healthcheck_for_instance( | |
mode = service_manifest.get_healthcheck_mode(smartstack_config) | ||
hostname = socket.getfqdn() | ||
|
||
if mode == "http" or mode == "https": | ||
if mode in ["http", "https", "http2"]: | ||
path = service_manifest.get_healthcheck_uri(smartstack_config) | ||
healthcheck_command = "%s://%s:%d%s" % (mode, hostname, random_port, path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (same as above re: http2 having a uri scheme of http) |
||
elif mode == "tcp": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_smartstack_endpoints()
will probably need some special handling since that passes through the mode as the uri scheme - but the http2 scheme is stillhttp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and i think the same needs to happen in
get_deployments_strings()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handling this with url_scheme even though service is http2 we will use http in endpoint url. Fixed in both cases.