From 5ce2747e54986768165c3adbd996c14df63fecd5 Mon Sep 17 00:00:00 2001 From: Daniel Young Lee Date: Wed, 6 Dec 2023 12:41:17 +0900 Subject: [PATCH] Include serving locality in create backend requests. --- src/gcp/frameworks.ts | 3 +++ src/init/features/frameworks/index.ts | 1 + src/test/init/frameworks/index.spec.ts | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gcp/frameworks.ts b/src/gcp/frameworks.ts index 77b93d1930b..45ced5529bc 100644 --- a/src/gcp/frameworks.ts +++ b/src/gcp/frameworks.ts @@ -19,11 +19,14 @@ interface Codebase { rootDirectory: string; } +export type ServingLocality = "GLOBAL_ACCESS" | "REGIONAL_STRICT"; + /** A Backend, the primary resource of Frameworks. */ export interface Backend { name: string; mode?: string; codebase: Codebase; + servingLocality: ServingLocality; labels: Record; createTime: string; updateTime: string; diff --git a/src/init/features/frameworks/index.ts b/src/init/features/frameworks/index.ts index 0f778f16091..c3749671b31 100644 --- a/src/init/features/frameworks/index.ts +++ b/src/init/features/frameworks/index.ts @@ -69,6 +69,7 @@ export async function doSetup(setup: any, projectId: string): Promise { function toBackend(cloudBuildConnRepo: Repository): Omit { return { + servingLocality: "GLOBAL_ACCESS", codebase: { repository: `${cloudBuildConnRepo.name}`, rootDirectory: "/", diff --git a/src/test/init/frameworks/index.spec.ts b/src/test/init/frameworks/index.spec.ts index af678372607..84ecadd34c4 100644 --- a/src/test/init/frameworks/index.spec.ts +++ b/src/test/init/frameworks/index.spec.ts @@ -60,7 +60,8 @@ describe("operationsConverter", () => { createTime: "0", updateTime: "1", }; - const backendInput = { + const backendInput: Omit = { + servingLocality: "GLOBAL_ACCESS", codebase: { repository: cloudBuildConnRepo.name, rootDirectory: "/",