@@ -850,14 +850,7 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment"), func() {
850850 })
851851
852852 By (fmt .Sprintf ("Updating the InstanceSize of Advanced Deployment %s" , kube .ObjectKeyFromObject (createdDeployment )), func () {
853- newInstanceSize := "M20"
854- createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ].AnalyticsSpecs = & mdbv1.Specs {
855- InstanceSize : newInstanceSize ,
856- }
857- createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ].ElectableSpecs .InstanceSize = newInstanceSize
858- createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ].ReadOnlySpecs = & mdbv1.Specs {
859- InstanceSize : newInstanceSize ,
860- }
853+ createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ].ElectableSpecs .InstanceSize = "M20"
861854 Expect (k8sClient .Update (context .Background (), createdDeployment )).ToNot (HaveOccurred ())
862855
863856 Eventually (func (g Gomega ) bool {
@@ -871,10 +864,12 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment"), func() {
871864 })
872865
873866 By (fmt .Sprintf ("Enable AutoScaling for the Advanced Deployment %s" , kube .ObjectKeyFromObject (createdDeployment )), func () {
874- createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ].AutoScaling = & mdbv1.AdvancedAutoScalingSpec {
867+ regionConfig := createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ]
868+ regionConfig .ElectableSpecs .InstanceSize = "M10"
869+ regionConfig .AutoScaling = & mdbv1.AdvancedAutoScalingSpec {
875870 Compute : & mdbv1.ComputeSpec {
876871 Enabled : toptr .MakePtr (true ),
877- MaxInstanceSize : "M20 " ,
872+ MaxInstanceSize : "M30 " ,
878873 MinInstanceSize : "M10" ,
879874 ScaleDownEnabled : toptr .MakePtr (true ),
880875 },
@@ -890,6 +885,22 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment"), func() {
890885
891886 doAdvancedDeploymentStatusChecks ()
892887 checkAdvancedAtlasState ()
888+
889+ lastGeneration ++
890+ })
891+
892+ By (fmt .Sprintf ("Update Instance Size Margins with AutoScaling for Deployemnt %s" , kube .ObjectKeyFromObject (createdDeployment )), func () {
893+ regionConfig := createdDeployment .Spec .AdvancedDeploymentSpec .ReplicationSpecs [0 ].RegionConfigs [0 ]
894+ regionConfig .AutoScaling .Compute .MinInstanceSize = "M20"
895+ regionConfig .ElectableSpecs .InstanceSize = "M20"
896+ Expect (k8sClient .Update (context .Background (), createdDeployment )).ToNot (HaveOccurred ())
897+
898+ Eventually (func (g Gomega ) bool {
899+ return testutil .CheckCondition (k8sClient , createdDeployment , status .TrueCondition (status .ReadyType ), validateDeploymentUpdatingFunc (g ))
900+ }).WithTimeout (30 * time .Minute ).WithPolling (interval ).Should (BeTrue ())
901+
902+ doAdvancedDeploymentStatusChecks ()
903+ checkAdvancedAtlasState ()
893904 })
894905 })
895906 })
0 commit comments