Add function in payload instead of just metadata (#1919)
Passing information of function from router to executor is more efficient than calling the K8S API. This change does that instead of passing only metadata and then executor calling the K8S API again.
This commit is contained in:
@@ -70,10 +70,10 @@ func MakeClient(logger *zap.Logger, executorURL string) *Client {
|
||||
}
|
||||
|
||||
// GetServiceForFunction returns the service name for a given function.
|
||||
func (c *Client) GetServiceForFunction(ctx context.Context, metadata *metav1.ObjectMeta) (string, error) {
|
||||
func (c *Client) GetServiceForFunction(ctx context.Context, fn *fv1.Function) (string, error) {
|
||||
executorURL := c.executorURL + "/v2/getServiceForFunction"
|
||||
|
||||
body, err := json.Marshal(metadata)
|
||||
body, err := json.Marshal(fn)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "could not marshal request body for getting service for function")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user