Skip to content

Commit 86d40aa

Browse files
authored
fix: Fix function name resolution on invoke (#216)
1 parent 85a1777 commit 86d40aa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

invoke/lib/invokeFunction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ const getGoogleCloudFunctionName = (serviceFunctions, func) => {
6565
throw new Error(errorMessage);
6666
}
6767

68-
return serviceFunctions[func].handler;
68+
return serviceFunctions[func].name;
6969
};

invoke/lib/invokeFunction.test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('InvokeFunction', () => {
2323
serverless.service.functions = {
2424
func1: {
2525
handler: 'foo',
26+
name: 'full-function-name',
2627
},
2728
};
2829
serverless.setProvider('google', new GoogleProvider(serverless));
@@ -77,7 +78,7 @@ describe('InvokeFunction', () => {
7778
'functions',
7879
'call',
7980
{
80-
name: 'projects/my-project/locations/us-central1/functions/foo',
81+
name: 'projects/my-project/locations/us-central1/functions/full-function-name',
8182
resource: {
8283
data: '',
8384
},
@@ -100,7 +101,7 @@ describe('InvokeFunction', () => {
100101
'functions',
101102
'call',
102103
{
103-
name: 'projects/my-project/locations/us-central1/functions/foo',
104+
name: 'projects/my-project/locations/us-central1/functions/full-function-name',
104105
resource: {
105106
data: googleInvoke.options.data,
106107
},

0 commit comments

Comments
 (0)