[autoscaler] Fix ingress manifest (#10618)

This commit is contained in:
PidgeyBE
2020-09-11 01:34:14 +02:00
committed by GitHub
parent c6b1ed7f8f
commit 9d7be89973
@@ -161,16 +161,11 @@ def _add_service_name_to_service_port(spec, svc_name):
for k in dict_keys:
spec[k] = _add_service_name_to_service_port(spec[k], svc_name)
# The magic string ${RAY_POD_NAME} is replaced with
# the true service name, which is equal to the worker pod name.
if k == "serviceName":
if spec[k] != "${RAY_POD_NAME}":
raise ValueError(
"The value of serviceName must be set to "
"${RAY_POD_NAME}. It is automatically replaced "
"when using the autoscaler.")
else:
spec["serviceName"] = svc_name
if k == "serviceName" and spec[k] != svc_name:
raise ValueError(
"The value of serviceName must be set to "
"${RAY_POD_NAME}. It is automatically replaced "
"when using the autoscaler.")
elif isinstance(spec, list):
spec = [
@@ -178,6 +173,8 @@ def _add_service_name_to_service_port(spec, svc_name):
]
elif isinstance(spec, str):
# The magic string ${RAY_POD_NAME} is replaced with
# the true service name, which is equal to the worker pod name.
if "${RAY_POD_NAME}" in spec:
spec = spec.replace("${RAY_POD_NAME}", svc_name)
return spec