You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validate container configuration in wrangler (#9774)
* CC-5513 Validate instance type in wrangler
Validate instance type against account limits to give early feedback to
the user.
* validate instance type in containers/deploy.ts
* clean up
* Update .changeset/twenty-seas-cross.md
Co-authored-by: emily-shen <[email protected]>
* refactor how limits are checked
* fix test
* Update changeset
* Update packages/wrangler/src/cloudchamber/limits.ts
Co-authored-by: emily-shen <[email protected]>
* Apply suggestions from code review
Co-authored-by: emily-shen <[email protected]>
* update comment
* fix tests
---------
Co-authored-by: emily-shen <[email protected]>
it("should throw error if app configured disk exceeds account limit",async()=>{
276
-
awaitexpect(()=>
277
-
ensureDiskLimits({
278
-
requiredSizeInBytes: 333*MiB,// 333MiB
279
-
account: accountBase,
280
-
configDiskInBytes: 3000*MiB,// ie 3GB - this exceeds the account limit of 2GB
281
-
})
282
-
).rejects.toThrowErrorMatchingInlineSnapshot(
283
-
`[Error: Exceeded account limits: Your container is configured to use a disk size of 3146MB. However, that exceeds the account limit of 2000MB]`
284
-
);
285
-
});
286
-
287
-
it("should throw error if image size exceeds allowed size",async()=>{
288
-
awaitexpect(()=>
289
-
ensureDiskLimits({
290
-
requiredSizeInBytes: 3000*MiB,// 3GiB
291
-
account: accountBase,
292
-
configDiskInBytes: undefined,
293
-
})
294
-
).rejects.toThrowErrorMatchingInlineSnapshot(
295
-
`[Error: Image too large: needs 3146MB, but your app is limited to images with size 2000MB. Your account needs more disk size per instance to run this container. The default disk size is 2GB.]`
296
-
);
297
-
});
298
-
299
-
it("should not throw when disk size is within limits",async()=>{
0 commit comments