@@ -134,7 +134,7 @@ func TestVolumeBadClassInImageBoundToGoodClass(t *testing.T) {
134134 volumeClass := adminapiv1.ClusterVolumeClass {
135135 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
136136 StorageClassName : getStorageClassName (t , storageClasses ),
137- SupportedRegions : []string {"local" },
137+ SupportedRegions : []string {apiv1 . LocalRegion },
138138 }
139139 if err = kclient .Create (ctx , & volumeClass ); err != nil {
140140 t .Fatal (err )
@@ -193,7 +193,7 @@ func TestVolumeBoundBadClass(t *testing.T) {
193193 volumeClass := adminapiv1.ClusterVolumeClass {
194194 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
195195 StorageClassName : getStorageClassName (t , storageClasses ),
196- SupportedRegions : []string {"local" },
196+ SupportedRegions : []string {apiv1 . LocalRegion },
197197 }
198198
199199 if err := kclient .Create (ctx , & volumeClass ); err != nil {
@@ -235,7 +235,7 @@ func TestVolumeClassInactive(t *testing.T) {
235235 volumeClass := adminapiv1.ClusterVolumeClass {
236236 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
237237 Inactive : true ,
238- SupportedRegions : []string {"local" },
238+ SupportedRegions : []string {apiv1 . LocalRegion },
239239 }
240240 if err := kclient .Create (ctx , & volumeClass ); err != nil {
241241 t .Fatal (err )
@@ -272,7 +272,7 @@ func TestVolumeClassSizeTooSmall(t *testing.T) {
272272 Min : "10Gi" ,
273273 Max : "100Gi" ,
274274 },
275- SupportedRegions : []string {"local" },
275+ SupportedRegions : []string {apiv1 . LocalRegion },
276276 }
277277 if err := kclient .Create (ctx , & volumeClass ); err != nil {
278278 t .Fatal (err )
@@ -316,7 +316,7 @@ func TestVolumeClassSizeTooLarge(t *testing.T) {
316316 Min : "10Gi" ,
317317 Max : "100Gi" ,
318318 },
319- SupportedRegions : []string {"local" },
319+ SupportedRegions : []string {apiv1 . LocalRegion },
320320 }
321321 if err := kclient .Create (ctx , & volumeClass ); err != nil {
322322 t .Fatal (err )
@@ -364,7 +364,7 @@ func TestVolumeClassRemoved(t *testing.T) {
364364 volumeClass := adminapiv1.ClusterVolumeClass {
365365 ObjectMeta : metav1.ObjectMeta {Name : "acorn-test-custom" },
366366 StorageClassName : getStorageClassName (t , storageClasses ),
367- SupportedRegions : []string {"local" },
367+ SupportedRegions : []string {apiv1 . LocalRegion },
368368 }
369369 if err = kclient .Create (ctx , & volumeClass ); err != nil {
370370 t .Fatal (err )
@@ -436,7 +436,7 @@ func TestClusterVolumeClass(t *testing.T) {
436436 Min : v1 .Quantity ("1G" ),
437437 Max : v1 .Quantity ("9G" ),
438438 },
439- SupportedRegions : []string {"local" },
439+ SupportedRegions : []string {apiv1 . LocalRegion },
440440 }
441441 if err = kclient .Create (ctx , & volumeClass ); err != nil {
442442 t .Fatal (err )
@@ -499,7 +499,7 @@ func TestClusterVolumeClassValuesInAcornfile(t *testing.T) {
499499 Min : v1 .Quantity ("1G" ),
500500 Max : v1 .Quantity ("9G" ),
501501 },
502- SupportedRegions : []string {"local" },
502+ SupportedRegions : []string {apiv1 . LocalRegion },
503503 }
504504 if err = kclient .Create (ctx , & volumeClass ); err != nil {
505505 t .Fatal (err )
@@ -558,7 +558,7 @@ func TestProjectVolumeClass(t *testing.T) {
558558 Min : v1 .Quantity ("1G" ),
559559 Max : v1 .Quantity ("3G" ),
560560 },
561- SupportedRegions : []string {"local" },
561+ SupportedRegions : []string {apiv1 . LocalRegion },
562562 }
563563 if err = kclient .Create (ctx , & volumeClass ); err != nil {
564564 t .Fatal (err )
@@ -624,7 +624,7 @@ func TestProjectVolumeClassDefaultSizeValidation(t *testing.T) {
624624 Max : v1 .Quantity ("9G" ),
625625 },
626626 Default : true ,
627- SupportedRegions : []string {"local" },
627+ SupportedRegions : []string {apiv1 . LocalRegion },
628628 }
629629 if err = kclient .Create (ctx , & volumeClass ); err != nil {
630630 t .Fatal (err )
@@ -735,7 +735,7 @@ func TestProjectVolumeClassValuesInAcornfile(t *testing.T) {
735735 Min : v1 .Quantity ("2G" ),
736736 Max : v1 .Quantity ("6G" ),
737737 },
738- SupportedRegions : []string {"local" },
738+ SupportedRegions : []string {apiv1 . LocalRegion },
739739 }
740740 if err = kclient .Create (ctx , & volumeClass ); err != nil {
741741 t .Fatal (err )
@@ -916,7 +916,7 @@ func TestUsingComputeClasses(t *testing.T) {
916916 Min : "512Mi" ,
917917 Max : "1Gi" ,
918918 },
919- SupportedRegions : []string {"local" },
919+ SupportedRegions : []string {apiv1 . LocalRegion },
920920 },
921921 expected : map [string ]v1.Scheduling {"simple" : {
922922 Requirements : corev1.ResourceRequirements {
@@ -951,7 +951,7 @@ func TestUsingComputeClasses(t *testing.T) {
951951 Memory : adminv1.ComputeClassMemory {
952952 Max : "1Gi" ,
953953 },
954- SupportedRegions : []string {"local" },
954+ SupportedRegions : []string {apiv1 . LocalRegion },
955955 },
956956 expected : map [string ]v1.Scheduling {"simple" : {
957957 Requirements : corev1.ResourceRequirements {
@@ -989,7 +989,7 @@ func TestUsingComputeClasses(t *testing.T) {
989989 "2Gi" ,
990990 },
991991 },
992- SupportedRegions : []string {"local" },
992+ SupportedRegions : []string {apiv1 . LocalRegion },
993993 },
994994 expected : map [string ]v1.Scheduling {"simple" : {
995995 Requirements : corev1.ResourceRequirements {
@@ -1027,7 +1027,7 @@ func TestUsingComputeClasses(t *testing.T) {
10271027 Max : "1Gi" ,
10281028 Min : "512Mi" ,
10291029 },
1030- SupportedRegions : []string {"local" },
1030+ SupportedRegions : []string {apiv1 . LocalRegion },
10311031 },
10321032 expected : map [string ]v1.Scheduling {"simple" : {
10331033 Requirements : corev1.ResourceRequirements {
@@ -1279,7 +1279,7 @@ func TestCrossProjectNetworkConnection(t *testing.T) {
12791279 }
12801280
12811281 // create two separate projects in which to run two Nginx apps
1282- proj1 , err := c .ProjectCreate (ctx , "proj1" , "local" , []string {"local" })
1282+ proj1 , err := c .ProjectCreate (ctx , "proj1" , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
12831283 if err != nil {
12841284 t .Fatal ("error while creating project:" , err )
12851285 }
@@ -1288,7 +1288,7 @@ func TestCrossProjectNetworkConnection(t *testing.T) {
12881288 t .Fatal ("error creating client for proj1:" , err )
12891289 }
12901290
1291- proj2 , err := c .ProjectCreate (ctx , "proj2" , "local" , []string {"local" })
1291+ proj2 , err := c .ProjectCreate (ctx , "proj2" , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
12921292 if err != nil {
12931293 t .Fatal ("error while creating project:" , err )
12941294 }
@@ -1455,7 +1455,7 @@ func TestProjectUpdate(t *testing.T) {
14551455 ctx := helper .GetCTX (t )
14561456 c , _ := helper .ClientAndNamespace (t )
14571457 projectName := uuid .New ().String ()[:8 ]
1458- proj1 , err := c .ProjectCreate (ctx , projectName , "local" , []string {"local" })
1458+ proj1 , err := c .ProjectCreate (ctx , projectName , apiv1 . LocalRegion , []string {apiv1 . LocalRegion })
14591459 if err != nil {
14601460 t .Fatal ("error while creating project:" , err )
14611461 }
@@ -1487,7 +1487,7 @@ func TestProjectUpdate(t *testing.T) {
14871487 }
14881488 // update default
14891489 for i := 0 ; i < 10 ; i ++ {
1490- updatedProj , err = proj1Client .ProjectUpdate (ctx , latestProject , "new-default" , []string {"local" })
1490+ updatedProj , err = proj1Client .ProjectUpdate (ctx , latestProject , "new-default" , []string {apiv1 . LocalRegion })
14911491 if err == nil {
14921492 break
14931493 }
@@ -1501,56 +1501,56 @@ func TestProjectUpdate(t *testing.T) {
15011501 }
15021502
15031503 assert .Equal (t , updatedProj .Spec .DefaultRegion , "new-default" )
1504- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "new-default" })
1504+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "new-default" })
15051505
15061506 // swap default from new-default to local
15071507 for i := 0 ; i < 10 ; i ++ {
15081508 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
15091509 if err != nil {
15101510 t .Fatal ("error while getting project:" , err )
15111511 }
1512- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "local" , nil )
1512+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , apiv1 . LocalRegion , nil )
15131513 if err == nil {
15141514 break
15151515 }
15161516 if ! apierrors .IsConflict (err ) {
15171517 t .Fatal ("error while updating project:" , err )
15181518 }
15191519 }
1520- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1521- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "new-default" })
1520+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1521+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "new-default" })
15221522
15231523 // remove new-default region
15241524 for i := 0 ; i < 10 ; i ++ {
15251525 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
15261526 if err != nil {
15271527 t .Fatal ("error while getting project:" , err )
15281528 }
1529- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {"local" })
1529+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {apiv1 . LocalRegion })
15301530 if err == nil {
15311531 break
15321532 }
15331533 if ! strings .Contains (err .Error (), "please apply your changes to the latest version and try again" ) {
15341534 t .Fatal ("error while updating project:" , err )
15351535 }
15361536 }
1537- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1538- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" })
1537+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1538+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion })
15391539
15401540 // set supported regions
15411541 for i := 0 ; i < 10 ; i ++ {
15421542 updatedProj , err = proj1Client .ProjectGet (ctx , projectName )
15431543 if err != nil {
15441544 t .Fatal ("error while getting project:" , err )
15451545 }
1546- updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {"local" , "local3" , "local2" })
1546+ updatedProj , err = proj1Client .ProjectUpdate (ctx , updatedProj , "" , []string {apiv1 . LocalRegion , "local3" , "local2" })
15471547 if err == nil {
15481548 break
15491549 }
15501550 if ! apierrors .IsConflict (err ) {
15511551 t .Fatal ("error while updating project:" , err )
15521552 }
15531553 }
1554- assert .Equal (t , updatedProj .Spec .DefaultRegion , "local" )
1555- assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {"local" , "local3" , "local2" })
1554+ assert .Equal (t , updatedProj .Spec .DefaultRegion , apiv1 . LocalRegion )
1555+ assert .Equal (t , updatedProj .Spec .SupportedRegions , []string {apiv1 . LocalRegion , "local3" , "local2" })
15561556}
0 commit comments