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:
@@ -160,7 +160,7 @@ func (c *Client) service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TapService sends a TapServiceRequest over the request channel.
|
// 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{
|
c.requestChan <- TapServiceRequest{
|
||||||
FnMetadata: metav1.ObjectMeta{
|
FnMetadata: metav1.ObjectMeta{
|
||||||
Name: fnMeta.Name,
|
Name: fnMeta.Name,
|
||||||
|
|||||||
@@ -455,10 +455,10 @@ func (roundTripper *RetryingRoundTripper) closeContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (fh *functionHandler) tapService(fn *fv1.Function, serviceURL *url.URL) {
|
func (fh *functionHandler) tapService(fn *fv1.Function, serviceURL *url.URL) {
|
||||||
if fh.executor == nil {
|
if fh.executor == nil || serviceURL == nil {
|
||||||
return
|
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) {
|
func (fh functionHandler) handler(responseWriter http.ResponseWriter, request *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user