Avoid tapservice call to executor with empty URL (#2402)

We should avoid tap service call to executor if service URL retrieved from executor is empty.
Added sanity checks to ensure that.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2022-04-06 09:41:54 +05:30
committed by GitHub
parent 24dee03e18
commit 8b3a3f29a8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ func (c *Client) service() {
}
// TapService sends a TapServiceRequest over the request channel.
func (c *Client) TapService(fnMeta metav1.ObjectMeta, executorType fv1.ExecutorType, serviceURL *url.URL) {
func (c *Client) TapService(fnMeta metav1.ObjectMeta, executorType fv1.ExecutorType, serviceURL url.URL) {
c.requestChan <- TapServiceRequest{
FnMetadata: metav1.ObjectMeta{
Name: fnMeta.Name,
+2 -2
View File
@@ -455,10 +455,10 @@ func (roundTripper *RetryingRoundTripper) closeContext() {
}
func (fh *functionHandler) tapService(fn *fv1.Function, serviceURL *url.URL) {
if fh.executor == nil {
if fh.executor == nil || serviceURL == nil {
return
}
fh.executor.TapService(fn.ObjectMeta, fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType, serviceURL)
fh.executor.TapService(fn.ObjectMeta, fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType, *serviceURL)
}
func (fh functionHandler) handler(responseWriter http.ResponseWriter, request *http.Request) {