@@ -150,7 +150,7 @@ describe("getNormalizedContainerOptions", () => {
150150 dockerfile : expect . stringMatching ( / [ / \\ ] D o c k e r f i l e $ / ) ,
151151 image_build_context : expect . stringMatching ( / [ / \\ ] [ ^ / \\ ] * $ / ) ,
152152 image_vars : undefined ,
153- constraints : { tier : 1 } ,
153+ constraints : { tiers : [ 1 , 2 ] } ,
154154 observability : {
155155 logs_enabled : false ,
156156 } ,
@@ -193,7 +193,7 @@ describe("getNormalizedContainerOptions", () => {
193193 rollout_kind : "full_auto" ,
194194 instance_type : "lite" ,
195195 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
196- constraints : { tier : 1 } ,
196+ constraints : { tiers : [ 1 , 2 ] } ,
197197 observability : {
198198 logs_enabled : false ,
199199 } ,
@@ -280,7 +280,7 @@ describe("getNormalizedContainerOptions", () => {
280280 memory_mib : 1024 ,
281281 vcpu : 2 ,
282282 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
283- constraints : { tier : 1 } ,
283+ constraints : { tiers : [ 1 , 2 ] } ,
284284 } ) ;
285285 } ) ;
286286
@@ -328,7 +328,7 @@ describe("getNormalizedContainerOptions", () => {
328328 memory_mib : 1024 ,
329329 vcpu : 2 ,
330330 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
331- constraints : { tier : 1 } ,
331+ constraints : { tiers : [ 1 , 2 ] } ,
332332 } ) ;
333333 } ) ;
334334
@@ -373,7 +373,7 @@ describe("getNormalizedContainerOptions", () => {
373373 memory_mib : 256 ,
374374 vcpu : 2 ,
375375 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
376- constraints : { tier : 1 } ,
376+ constraints : { tiers : [ 1 , 2 ] } ,
377377 } ) ;
378378 } ) ;
379379
@@ -414,7 +414,7 @@ describe("getNormalizedContainerOptions", () => {
414414 rollout_kind : "full_auto" ,
415415 instance_type : "standard" ,
416416 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
417- constraints : { tier : 1 } ,
417+ constraints : { tiers : [ 1 , 2 ] } ,
418418 } ) ;
419419 } ) ;
420420
@@ -472,7 +472,7 @@ describe("getNormalizedContainerOptions", () => {
472472 instance_type : "basic" ,
473473 image_uri : "registry.cloudflare.com/some-account-id/test:latest" ,
474474 constraints : {
475- tier : 2 ,
475+ tiers : [ 2 ] ,
476476 regions : [ "US-EAST-1" , "US-WEST-2" ] ,
477477 cities : [ "nyc" , "sf" ] ,
478478 } ,
@@ -525,7 +525,7 @@ describe("getNormalizedContainerOptions", () => {
525525 dockerfile : expect . stringMatching ( / [ / \\ ] n e s t e d [ / \\ ] D o c k e r f i l e $ / ) ,
526526 image_build_context : expect . stringMatching ( / [ / \\ ] n e s t e d $ / ) ,
527527 image_vars : undefined ,
528- constraints : { tier : 1 } ,
528+ constraints : { tiers : [ 1 , 2 ] } ,
529529 observability : {
530530 logs_enabled : false ,
531531 } ,
@@ -634,7 +634,36 @@ describe("getNormalizedContainerOptions", () => {
634634
635635 const result = await getNormalizedContainerOptions ( config , { } ) ;
636636 expect ( result ) . toHaveLength ( 1 ) ;
637- expect ( result [ 0 ] . constraints . tier ) . toBeUndefined ( ) ;
637+ expect ( result [ 0 ] . constraints . tiers ) . toBeUndefined ( ) ;
638+ } ) ;
639+
640+ it ( "should convert deprecated tier to tiers array" , async ( ) => {
641+ const config : Config = {
642+ name : "test-worker" ,
643+ containers : [
644+ {
645+ class_name : "TestContainer" ,
646+ image : `${ getCloudflareContainerRegistry ( ) } /test:latest` ,
647+ name : "test-container" ,
648+ constraints : {
649+ tier : 3 ,
650+ } ,
651+ } ,
652+ ] ,
653+ durable_objects : {
654+ bindings : [
655+ {
656+ name : "TEST_DO" ,
657+ class_name : "TestContainer" ,
658+ } ,
659+ ] ,
660+ } ,
661+ migrations : [ { tag : "v1" , new_sqlite_classes : [ "TestContainer" ] } ] ,
662+ } as Partial < Config > as Config ;
663+
664+ const result = await getNormalizedContainerOptions ( config , { } ) ;
665+ expect ( result ) . toHaveLength ( 1 ) ;
666+ expect ( result [ 0 ] . constraints . tiers ) . toEqual ( [ 3 ] ) ;
638667 } ) ;
639668
640669 it ( "should default rollout_step_percentage to 100 when max_instances is 1" , async ( ) => {
0 commit comments