Skip to content

Commit d5a83c4

Browse files
authored
Add private flag for disabling eager check for decommissioned functions (#8156)
* Add private flag for disabling eager check for decomissioned functions runtimes * Formatter
1 parent e343921 commit d5a83c4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/deploy/functions/prepare.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as args from "./args";
44
import * as proto from "../../gcp/proto";
55
import * as backend from "./backend";
66
import * as build from "./build";
7+
import * as experiments from "../../experiments";
78
import * as ensureApiEnabled from "../../ensureApiEnabled";
89
import * as functionsConfig from "../../functionsConfig";
910
import * as functionsEnv from "../../functions/env";
@@ -504,7 +505,9 @@ export async function loadCodebases(
504505
}
505506
const runtimeDelegate = await runtimes.getRuntimeDelegate(delegateContext);
506507
logger.debug(`Validating ${runtimeDelegate.language} source`);
507-
supported.guardVersionSupport(runtimeDelegate.runtime);
508+
if (!experiments.isEnabled("bypassfunctionsdeprecationcheck")) {
509+
supported.guardVersionSupport(runtimeDelegate.runtime);
510+
}
508511
await runtimeDelegate.validate();
509512
logger.debug(`Building ${runtimeDelegate.language} source`);
510513
await runtimeDelegate.build();

src/experiments.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ export const ALL_EXPERIMENTS = experiments({
7777
shortDescription: "Use Cloud Run API to list v2 functions",
7878
public: false,
7979
},
80+
bypassfunctionsdeprecationcheck: {
81+
shortDescription: "Bypass Functions check for old runtimes",
82+
fullDescription:
83+
"Bypasses the local check for whether a functions runtime is " +
84+
"decommissioned. This does not, by itself, allow you to deploy a function with a " +
85+
"decommissioned runtime, as there are server-side checks as well.",
86+
public: false,
87+
default: false,
88+
},
8089

8190
// Emulator experiments
8291
emulatoruisnapshot: {

0 commit comments

Comments
 (0)