@@ -460,8 +460,42 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment"), func() {
460460 })
461461 })
462462
463+ It ("Should Success (AWS) with enabled autoscaling" , func () {
464+ createdDeployment = mdbv1 .DefaultAWSDeployment (namespace .Name , createdProject .Name )
465+ createdDeployment .Spec .DeploymentSpec .DiskSizeGB = intptr (20 )
466+ createdDeployment .Spec .DeploymentSpec .AutoScaling = & mdbv1.AutoScalingSpec {
467+ AutoIndexingEnabled : boolptr (true ),
468+ DiskGBEnabled : boolptr (true ),
469+ }
470+
471+ By (fmt .Sprintf ("Creating the Deployment %s with autoscaling" , kube .ObjectKeyFromObject (createdDeployment )), func () {
472+ Expect (k8sClient .Create (context .Background (), createdDeployment )).ToNot (HaveOccurred ())
473+
474+ Eventually (testutil .WaitFor (k8sClient , createdDeployment , status .TrueCondition (status .ReadyType ), validateDeploymentCreatingFunc ()),
475+ DeploymentUpdateTimeout , interval ).Should (BeTrue ())
476+
477+ doRegularDeploymentStatusChecks ()
478+ checkAtlasState ()
479+ })
480+
481+ By ("Decreasing the Deployment disk size should not take effect" , func () {
482+ prevDiskSize := * createdDeployment .Spec .DeploymentSpec .DiskSizeGB
483+ createdDeployment .Spec .DeploymentSpec .DiskSizeGB = intptr (14 )
484+ performUpdate (30 * time .Minute )
485+ doRegularDeploymentStatusChecks ()
486+ checkAtlasState (func (c * mongodbatlas.Cluster ) {
487+ Expect (* c .DiskSizeGB ).To (BeEquivalentTo (prevDiskSize ))
488+
489+ // check whether https://github.com/mongodb/go-client-mongodb-atlas/issues/140 is fixed
490+ Expect (c .DiskSizeGB ).To (BeAssignableToTypeOf (float64ptr (0 )), "DiskSizeGB is no longer a *float64, please check the spec!" )
491+ })
492+ })
493+ })
494+
463495 It ("Should Succeed (AWS)" , func () {
464496 createdDeployment = mdbv1 .DefaultAWSDeployment (namespace .Name , createdProject .Name )
497+ createdDeployment .Spec .DeploymentSpec .DiskSizeGB = intptr (20 )
498+ createdDeployment = createdDeployment .WithAutoscalingDisabled ()
465499
466500 By (fmt .Sprintf ("Creating the Deployment %s" , kube .ObjectKeyFromObject (createdDeployment )), func () {
467501 Expect (k8sClient .Create (context .Background (), createdDeployment )).ToNot (HaveOccurred ())
@@ -490,7 +524,7 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment"), func() {
490524 })
491525
492526 By ("Decreasing the Deployment disk size" , func () {
493- createdDeployment .Spec .DeploymentSpec .DiskSizeGB = intptr (10 )
527+ createdDeployment .Spec .DeploymentSpec .DiskSizeGB = intptr (15 )
494528 performUpdate (20 * time .Minute )
495529 doRegularDeploymentStatusChecks ()
496530 checkAtlasState (func (c * mongodbatlas.Cluster ) {
0 commit comments