diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..e7226b0942c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Fixes issue with updateService in runv2.ts (#9918) diff --git a/src/gcp/runv2.spec.ts b/src/gcp/runv2.spec.ts index 683d08ee198..8922d97be63 100644 --- a/src/gcp/runv2.spec.ts +++ b/src/gcp/runv2.spec.ts @@ -451,7 +451,7 @@ describe("runv2", () => { entryPoint: SERVICE_ID, // No FUNCTION_TARGET_ANNOTATION availableMemoryMb: 128, cpu: 0.5, - eventTrigger: { eventType: "unknown", retry: false }, + httpsTrigger: {}, labels: {}, environmentVariables: {}, secretEnvironmentVariables: [], diff --git a/src/gcp/runv2.ts b/src/gcp/runv2.ts index 4796d3d439b..7ea8b8a77d5 100644 --- a/src/gcp/runv2.ts +++ b/src/gcp/runv2.ts @@ -196,7 +196,7 @@ export async function updateService(service: Omit) ); // Always update revision name to ensure null generates a new unique revision name. fieldMask.push("template.revision"); - const res = await client.post, LongRunningOperation>( + const res = await client.patch, LongRunningOperation>( service.name, service, { @@ -619,7 +619,8 @@ export function endpointFromService(service: Omit) ? "ALLOW_INTERNAL_AND_GCLB" : "ALLOW_ALL") as backend.IngressSettings, // TODO: Figure out how to encode all trigger types to the underlying Run service that is compatible with both V2 functions and "direct to run" functions - ...(service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER" + ...(!service.annotations?.[TRIGGER_TYPE_ANNOTATION] || + service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER" ? { httpsTrigger: {} } : { eventTrigger: {