Skip to content

Commit

Permalink
fix: Fix function name resolution on invoke (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
scastiel authored May 11, 2020
1 parent 85a1777 commit 86d40aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion invoke/lib/invokeFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ const getGoogleCloudFunctionName = (serviceFunctions, func) => {
throw new Error(errorMessage);
}

return serviceFunctions[func].handler;
return serviceFunctions[func].name;
};
5 changes: 3 additions & 2 deletions invoke/lib/invokeFunction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('InvokeFunction', () => {
serverless.service.functions = {
func1: {
handler: 'foo',
name: 'full-function-name',
},
};
serverless.setProvider('google', new GoogleProvider(serverless));
Expand Down Expand Up @@ -77,7 +78,7 @@ describe('InvokeFunction', () => {
'functions',
'call',
{
name: 'projects/my-project/locations/us-central1/functions/foo',
name: 'projects/my-project/locations/us-central1/functions/full-function-name',
resource: {
data: '',
},
Expand All @@ -100,7 +101,7 @@ describe('InvokeFunction', () => {
'functions',
'call',
{
name: 'projects/my-project/locations/us-central1/functions/foo',
name: 'projects/my-project/locations/us-central1/functions/full-function-name',
resource: {
data: googleInvoke.options.data,
},
Expand Down

0 comments on commit 86d40aa

Please sign in to comment.