@@ -116,6 +116,39 @@ var _ = Describe("PlacementAPI controller", func() {
116116 })
117117 })
118118
119+ When ("starts zero replicas" , func () {
120+ BeforeEach (func () {
121+ spec := GetDefaultPlacementAPISpec ()
122+ spec ["replicas" ] = 0
123+ DeferCleanup (
124+ th .DeleteInstance ,
125+ CreatePlacementAPI (names .PlacementAPIName , spec ),
126+ )
127+ DeferCleanup (
128+ k8sClient .Delete , ctx , CreatePlacementAPISecret (namespace , SecretName ))
129+ keystoneAPIName := keystone .CreateKeystoneAPI (namespace )
130+ DeferCleanup (keystone .DeleteKeystoneAPI , keystoneAPIName )
131+
132+ })
133+ It ("and deployment is Ready" , func () {
134+ serviceSpec := corev1.ServiceSpec {Ports : []corev1.ServicePort {{Port : 3306 }}}
135+ DeferCleanup (
136+ mariadb .DeleteDBService ,
137+ mariadb .CreateDBService (namespace , "openstack" , serviceSpec ),
138+ )
139+ mariadb .SimulateMariaDBDatabaseCompleted (names .MariaDBDatabaseName )
140+ th .SimulateJobSuccess (names .DBSyncJobName )
141+ placement := GetPlacementAPI (names .PlacementAPIName )
142+ Expect (* (placement .Spec .Replicas )).Should (Equal (int32 (0 )))
143+ th .ExpectCondition (
144+ names .PlacementAPIName ,
145+ ConditionGetterFunc (PlacementConditionGetter ),
146+ condition .DeploymentReadyCondition ,
147+ corev1 .ConditionTrue ,
148+ )
149+ })
150+ })
151+
119152 When ("a secret is provided with missing fields" , func () {
120153 BeforeEach (func () {
121154 DeferCleanup (
0 commit comments