@@ -3,7 +3,7 @@ import * as clc from "colorette";
33import * as fs from "fs" ;
44
55import { checkHttpIam } from "./checkIam" ;
6- import { logSuccess , logWarning } from "../../utils" ;
6+ import { logLabeledWarning , logSuccess , logWarning } from "../../utils" ;
77import { Options } from "../../options" ;
88import { configForCodebase } from "../../functions/projectConfig" ;
99import * as args from "./args" ;
@@ -30,9 +30,20 @@ async function uploadSourceV1(
3030 file : source . functionsSourceV1 ! ,
3131 stream : fs . createReadStream ( source . functionsSourceV1 ! ) ,
3232 } ;
33- await gcs . upload ( uploadOpts , uploadUrl , {
34- "x-goog-content-length-range" : "0,104857600" ,
35- } ) ;
33+ if ( process . env . GOOGLE_CLOUD_QUOTA_PROJECT ) {
34+ logLabeledWarning (
35+ "functions" ,
36+ "GOOGLE_CLOUD_QUTOA_PROJECT is not usable when uploading source for Cloud Functions." ,
37+ ) ;
38+ }
39+ await gcs . upload (
40+ uploadOpts ,
41+ uploadUrl ,
42+ {
43+ "x-goog-content-length-range" : "0,104857600" ,
44+ } ,
45+ true , // ignoreQuotaProject
46+ ) ;
3647 return uploadUrl ;
3748}
3849
@@ -51,7 +62,13 @@ async function uploadSourceV2(
5162 file : source . functionsSourceV2 ! ,
5263 stream : fs . createReadStream ( source . functionsSourceV2 ! ) ,
5364 } ;
54- await gcs . upload ( uploadOpts , res . uploadUrl ) ;
65+ if ( process . env . GOOGLE_CLOUD_QUOTA_PROJECT ) {
66+ logLabeledWarning (
67+ "functions" ,
68+ "GOOGLE_CLOUD_QUTOA_PROJECT is not usable when uploading source for Cloud Functions." ,
69+ ) ;
70+ }
71+ await gcs . upload ( uploadOpts , res . uploadUrl , undefined , true /* ignoreQuotaProject */ ) ;
5572 return res . storageSource ;
5673}
5774
0 commit comments