Skip to content

Commit 0919bad

Browse files
committed
modifies updateService
1 parent 2db9277 commit 0919bad

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/gcp/runv2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ describe("runv2", () => {
451451
entryPoint: SERVICE_ID, // No FUNCTION_TARGET_ANNOTATION
452452
availableMemoryMb: 128,
453453
cpu: 0.5,
454-
eventTrigger: { eventType: "unknown", retry: false },
454+
httpsTrigger: {},
455455
labels: {},
456456
environmentVariables: {},
457457
secretEnvironmentVariables: [],

src/gcp/runv2.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export async function updateService(service: Omit<Service, ServiceOutputFields>)
196196
);
197197
// Always update revision name to ensure null generates a new unique revision name.
198198
fieldMask.push("template.revision");
199-
const res = await client.post<Omit<Service, ServiceOutputFields>, LongRunningOperation<Service>>(
199+
const res = await client.patch<Omit<Service, ServiceOutputFields>, LongRunningOperation<Service>>(
200200
service.name,
201201
service,
202202
{
@@ -619,7 +619,8 @@ export function endpointFromService(service: Omit<Service, ServiceOutputFields>)
619619
? "ALLOW_INTERNAL_AND_GCLB"
620620
: "ALLOW_ALL") as backend.IngressSettings,
621621
// 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
622-
...(service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER"
622+
...(!service.annotations?.[TRIGGER_TYPE_ANNOTATION] ||
623+
service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER"
623624
? { httpsTrigger: {} }
624625
: {
625626
eventTrigger: {

0 commit comments

Comments
 (0)