Skip to content

Commit d5a179a

Browse files
authored
Prevent pinTags + minInstances from any functions, not just frameworks (#6684)
* Prevent pinTags + minInstances from any functions rewrite, not just web frameworks * Changelog * Changelog formatting
1 parent 6b0cb5d commit d5a179a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Prevent the use of pinTags + minInstances on the same function, as the features are not mutually compatible (#6684)

src/deploy/hosting/convertConfig.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ export async function convertConfig(
218218
},
219219
};
220220
if (rewrite.function.pinTag) {
221+
// b/319616292. Functions currently set min instances at the revision
222+
// level and Run will maintain all those min instances for each revision
223+
// whenever that revision is accessible (e.g. via a traffic tag). This
224+
// can lead to customers paying lots of money with zero benefit. Until
225+
// Run makes min instances dynamic, we must not allow both features to
226+
// be used at the same time.
227+
if (endpoint.minInstances) {
228+
throw new FirebaseError(
229+
`Function ${endpoint.id} has minInstances set and is in a rewrite ` +
230+
"pinTags=true. These features are not currently compatible with each " +
231+
"other."
232+
);
233+
}
221234
experiments.assertEnabled("pintags", "pin a function version");
222235
apiRewrite.run.tag = runTags.TODO_TAG_NAME;
223236
}

0 commit comments

Comments
 (0)