@@ -3,7 +3,7 @@ import * as clc from "colorette";
3
3
import * as fs from "fs" ;
4
4
5
5
import { checkHttpIam } from "./checkIam" ;
6
- import { logSuccess , logWarning } from "../../utils" ;
6
+ import { logLabeledWarning , logSuccess , logWarning } from "../../utils" ;
7
7
import { Options } from "../../options" ;
8
8
import { configForCodebase } from "../../functions/projectConfig" ;
9
9
import * as args from "./args" ;
@@ -30,9 +30,20 @@ async function uploadSourceV1(
30
30
file : source . functionsSourceV1 ! ,
31
31
stream : fs . createReadStream ( source . functionsSourceV1 ! ) ,
32
32
} ;
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
+ ) ;
36
47
return uploadUrl ;
37
48
}
38
49
@@ -51,7 +62,13 @@ async function uploadSourceV2(
51
62
file : source . functionsSourceV2 ! ,
52
63
stream : fs . createReadStream ( source . functionsSourceV2 ! ) ,
53
64
} ;
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 */ ) ;
55
72
return res . storageSource ;
56
73
}
57
74
0 commit comments