From c9bde90590ab742b9b9335f6b7c9f96f517db51f Mon Sep 17 00:00:00 2001 From: Ce Gao Date: Fri, 27 Sep 2019 12:07:35 +0800 Subject: [PATCH] fix: Support multiple namespaces Signed-off-by: Ce Gao --- pkg/controller.v1alpha3/util/suggestion.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller.v1alpha3/util/suggestion.go b/pkg/controller.v1alpha3/util/suggestion.go index 0dd5cb4faa2..bbf309fb8a5 100644 --- a/pkg/controller.v1alpha3/util/suggestion.go +++ b/pkg/controller.v1alpha3/util/suggestion.go @@ -15,7 +15,11 @@ func GetAlgorithmServiceName(s *suggestionsv1alpha3.Suggestion) string { return s.Name + "-" + s.Spec.AlgorithmName } +// GetAlgorithmEndpoint returns the endpoint of the algorithm service. func GetAlgorithmEndpoint(s *suggestionsv1alpha3.Suggestion) string { serviceName := GetAlgorithmServiceName(s) - return fmt.Sprintf("%s:%d", serviceName, consts.DefaultSuggestionPort) + return fmt.Sprintf("%s.%s:%d", + serviceName, + s.Namespace, + consts.DefaultSuggestionPort) }