@@ -133,7 +133,7 @@ func TestVolumeBadClassInImageBoundToGoodClass(t *testing.T) {
133133 volumeClass := adminapiv1.ClusterVolumeClass {
134134 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
135135 StorageClassName : getStorageClassName (t , storageClasses ),
136- SupportedRegions : []string {"local" },
136+ SupportedRegions : []string {apiv1 . LocalRegion },
137137 }
138138 if err = kclient .Create (ctx , & volumeClass ); err != nil {
139139 t .Fatal (err )
@@ -192,7 +192,7 @@ func TestVolumeBoundBadClass(t *testing.T) {
192192 volumeClass := adminapiv1.ClusterVolumeClass {
193193 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
194194 StorageClassName : getStorageClassName (t , storageClasses ),
195- SupportedRegions : []string {"local" },
195+ SupportedRegions : []string {apiv1 . LocalRegion },
196196 }
197197
198198 if err := kclient .Create (ctx , & volumeClass ); err != nil {
@@ -234,7 +234,7 @@ func TestVolumeClassInactive(t *testing.T) {
234234 volumeClass := adminapiv1.ClusterVolumeClass {
235235 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
236236 Inactive : true ,
237- SupportedRegions : []string {"local" },
237+ SupportedRegions : []string {apiv1 . LocalRegion },
238238 }
239239 if err := kclient .Create (ctx , & volumeClass ); err != nil {
240240 t .Fatal (err )
@@ -271,7 +271,7 @@ func TestVolumeClassSizeTooSmall(t *testing.T) {
271271 Min : "10Gi" ,
272272 Max : "100Gi" ,
273273 },
274- SupportedRegions : []string {"local" },
274+ SupportedRegions : []string {apiv1 . LocalRegion },
275275 }
276276 if err := kclient .Create (ctx , & volumeClass ); err != nil {
277277 t .Fatal (err )
@@ -315,7 +315,7 @@ func TestVolumeClassSizeTooLarge(t *testing.T) {
315315 Min : "10Gi" ,
316316 Max : "100Gi" ,
317317 },
318- SupportedRegions : []string {"local" },
318+ SupportedRegions : []string {apiv1 . LocalRegion },
319319 }
320320 if err := kclient .Create (ctx , & volumeClass ); err != nil {
321321 t .Fatal (err )
@@ -363,7 +363,7 @@ func TestVolumeClassRemoved(t *testing.T) {
363363 volumeClass := adminapiv1.ClusterVolumeClass {
364364 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
365365 StorageClassName : getStorageClassName (t , storageClasses ),
366- SupportedRegions : []string {"local" },
366+ SupportedRegions : []string {apiv1 . LocalRegion },
367367 }
368368 if err = kclient .Create (ctx , & volumeClass ); err != nil {
369369 t .Fatal (err )
@@ -435,7 +435,7 @@ func TestClusterVolumeClass(t *testing.T) {
435435 Min : v1 .Quantity ("1G" ),
436436 Max : v1 .Quantity ("9G" ),
437437 },
438- SupportedRegions : []string {"local" },
438+ SupportedRegions : []string {apiv1 . LocalRegion },
439439 }
440440 if err = kclient .Create (ctx , & volumeClass ); err != nil {
441441 t .Fatal (err )
@@ -498,7 +498,7 @@ func TestClusterVolumeClassValuesInAcornfile(t *testing.T) {
498498 Min : v1 .Quantity ("1G" ),
499499 Max : v1 .Quantity ("9G" ),
500500 },
501- SupportedRegions : []string {"local" },
501+ SupportedRegions : []string {apiv1 . LocalRegion },
502502 }
503503 if err = kclient .Create (ctx , & volumeClass ); err != nil {
504504 t .Fatal (err )
@@ -557,7 +557,7 @@ func TestProjectVolumeClass(t *testing.T) {
557557 Min : v1 .Quantity ("1G" ),
558558 Max : v1 .Quantity ("3G" ),
559559 },
560- SupportedRegions : []string {"local" },
560+ SupportedRegions : []string {apiv1 . LocalRegion },
561561 }
562562 if err = kclient .Create (ctx , & volumeClass ); err != nil {
563563 t .Fatal (err )
@@ -623,7 +623,7 @@ func TestProjectVolumeClassDefaultSizeValidation(t *testing.T) {
623623 Max : v1 .Quantity ("9G" ),
624624 },
625625 Default : true ,
626- SupportedRegions : []string {"local" },
626+ SupportedRegions : []string {apiv1 . LocalRegion },
627627 }
628628 if err = kclient .Create (ctx , & volumeClass ); err != nil {
629629 t .Fatal (err )
@@ -734,7 +734,7 @@ func TestProjectVolumeClassValuesInAcornfile(t *testing.T) {
734734 Min : v1 .Quantity ("2G" ),
735735 Max : v1 .Quantity ("6G" ),
736736 },
737- SupportedRegions : []string {"local" },
737+ SupportedRegions : []string {apiv1 . LocalRegion },
738738 }
739739 if err = kclient .Create (ctx , & volumeClass ); err != nil {
740740 t .Fatal (err )
@@ -915,7 +915,7 @@ func TestUsingComputeClasses(t *testing.T) {
915915 Min : "512Mi" ,
916916 Max : "1Gi" ,
917917 },
918- SupportedRegions : []string {"local" },
918+ SupportedRegions : []string {apiv1 . LocalRegion },
919919 },
920920 expected : map [string ]v1.Scheduling {"simple" : {
921921 Requirements : corev1.ResourceRequirements {
@@ -950,7 +950,7 @@ func TestUsingComputeClasses(t *testing.T) {
950950 Memory : adminv1.ComputeClassMemory {
951951 Max : "1Gi" ,
952952 },
953- SupportedRegions : []string {"local" },
953+ SupportedRegions : []string {apiv1 . LocalRegion },
954954 },
955955 expected : map [string ]v1.Scheduling {"simple" : {
956956 Requirements : corev1.ResourceRequirements {
@@ -988,7 +988,7 @@ func TestUsingComputeClasses(t *testing.T) {
988988 "2Gi" ,
989989 },
990990 },
991- SupportedRegions : []string {"local" },
991+ SupportedRegions : []string {apiv1 . LocalRegion },
992992 },
993993 expected : map [string ]v1.Scheduling {"simple" : {
994994 Requirements : corev1.ResourceRequirements {
@@ -1026,7 +1026,7 @@ func TestUsingComputeClasses(t *testing.T) {
10261026 Max : "1Gi" ,
10271027 Min : "512Mi" ,
10281028 },
1029- SupportedRegions : []string {"local" },
1029+ SupportedRegions : []string {apiv1 . LocalRegion },
10301030 },
10311031 expected : map [string ]v1.Scheduling {"simple" : {
10321032 Requirements : corev1.ResourceRequirements {
@@ -1246,7 +1246,7 @@ func TestCrossProjectNetworkConnection(t *testing.T) {
12461246 }
12471247
12481248 // create two separate projects in which to run two Nginx apps
1249- proj1 , err := c .ProjectCreate (ctx , "proj1" , "local" , []string {"local" })
1249+ proj1 , err := c .ProjectCreate (ctx , "proj1" , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
12501250 if err != nil {
12511251 t .Fatal ("error while creating project:" , err )
12521252 }
@@ -1255,7 +1255,7 @@ func TestCrossProjectNetworkConnection(t *testing.T) {
12551255 t .Fatal ("error creating client for proj1:" , err )
12561256 }
12571257
1258- proj2 , err := c .ProjectCreate (ctx , "proj2" , "local" , []string {"local" })
1258+ proj2 , err := c .ProjectCreate (ctx , "proj2" , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
12591259 if err != nil {
12601260 t .Fatal ("error while creating project:" , err )
12611261 }
@@ -1422,7 +1422,7 @@ func TestProjectUpdate(t *testing.T) {
14221422 ctx := helper .GetCTX (t )
14231423 c , _ := helper .ClientAndNamespace (t )
14241424 projectName := uuid .New ().String ()[:8 ]
1425- proj1 , err := c .ProjectCreate (ctx , projectName , "local" , []string {"local" })
1425+ proj1 , err := c .ProjectCreate (ctx , projectName , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
14261426 if err != nil {
14271427 t .Fatal ("error while creating project:" , err )
14281428 }
@@ -1454,7 +1454,7 @@ func TestProjectUpdate(t *testing.T) {
14541454 }
14551455 // update default
14561456 for i := 0 ; i < 10 ; i ++ {
1457- updatedProj , err = proj1Client .ProjectUpdate (ctx , latestProject , "new-default" , []string {"local" })
1457+ updatedProj , err = proj1Client .ProjectUpdate (ctx , latestProject , "new-default" , []string {apiv1 . LocalRegion })
14581458 if err == nil {
14591459 break
14601460 }
@@ -1468,56 +1468,56 @@ func TestProjectUpdate(t *testing.T) {
14681468 }
14691469
14701470 assert .Equal (t , updatedProj .Spec .DefaultRegion , "new-default" )
1471- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "new-default" })
1471+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "new-default" })
14721472
14731473 // swap default from new-default to local
14741474 for i := 0 ; i < 10 ; i ++ {
14751475 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
14761476 if err != nil {
14771477 t .Fatal ("error while getting project:" , err )
14781478 }
1479- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "local" , nil )
1479+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , apiv1 . LocalRegion , nil )
14801480 if err == nil {
14811481 break
14821482 }
14831483 if ! apierrors .IsConflict (err ) {
14841484 t .Fatal ("error while updating project:" , err )
14851485 }
14861486 }
1487- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1488- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "new-default" })
1487+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1488+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "new-default" })
14891489
14901490 // remove new-default region
14911491 for i := 0 ; i < 10 ; i ++ {
14921492 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
14931493 if err != nil {
14941494 t .Fatal ("error while getting project:" , err )
14951495 }
1496- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {"local" })
1496+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {apiv1 . LocalRegion })
14971497 if err == nil {
14981498 break
14991499 }
15001500 if ! strings .Contains (err .Error (), "please apply your changes to the latest version and try again" ) {
15011501 t .Fatal ("error while updating project:" , err )
15021502 }
15031503 }
1504- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1505- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" })
1504+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1505+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion })
15061506
15071507 // set supported regions
15081508 for i := 0 ; i < 10 ; i ++ {
15091509 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
15101510 if err != nil {
15111511 t .Fatal ("error while getting project:" , err )
15121512 }
1513- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {"local" , "local3" , "local2" })
1513+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {apiv1 . LocalRegion , "local3" , "local2" })
15141514 if err == nil {
15151515 break
15161516 }
15171517 if ! apierrors .IsConflict (err ) {
15181518 t .Fatal ("error while updating project:" , err )
15191519 }
15201520 }
1521- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1522- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "local3" , "local2" })
1521+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1522+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "local3" , "local2" })
15231523}
0 commit comments