Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Point v2 function target to entrypoint. (#6698)
- Fixed issue where Auth emulator sign in with Google only shows default tenant. (#6683)
- Prevent the use of pinTags + minInstances on the same function, as the features are not mutually compatible (#6684)
- Added force flag to delete backend (#6635).
Expand Down
6 changes: 2 additions & 4 deletions src/gcp/cloudfunctionsv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export async function createFunction(cloudFunction: InputCloudFunction): Promise

cloudFunction.serviceConfig.environmentVariables = {
...cloudFunction.serviceConfig.environmentVariables,
FUNCTION_TARGET: functionId.replaceAll("-", "."),
FUNCTION_TARGET: cloudFunction.buildConfig.entryPoint.replaceAll("-", "."),
};

try {
Expand Down Expand Up @@ -418,8 +418,6 @@ async function listFunctionsInternal(
* Customers can force a field to be deleted by setting that field to `undefined`
*/
export async function updateFunction(cloudFunction: InputCloudFunction): Promise<Operation> {
const components = cloudFunction.name.split("/");
const functionId = components.splice(-1, 1)[0];
// Keys in labels and environmentVariables and secretEnvironmentVariables are user defined, so we don't recurse
// for field masks.
const fieldMasks = proto.fieldMasks(
Expand All @@ -439,7 +437,7 @@ export async function updateFunction(cloudFunction: InputCloudFunction): Promise

cloudFunction.serviceConfig.environmentVariables = {
...cloudFunction.serviceConfig.environmentVariables,
FUNCTION_TARGET: functionId.replaceAll("-", "."),
FUNCTION_TARGET: cloudFunction.buildConfig.entryPoint.replaceAll("-", "."),
};

try {
Expand Down