@@ -1338,6 +1338,51 @@ var _ = Describe("Manila controller", func() {
13381338 g .Expect (conf ).To (ContainSubstring ("amqp_durable_queues=true" ))
13391339 }, timeout , interval ).Should (Succeed ())
13401340 })
1341+
1342+ It ("includes region_name in config when KeystoneAPI has region set" , func () {
1343+ const testRegion = "regionTwo"
1344+ // Create and update KeystoneAPI with region in status
1345+ keystoneAPIName := keystone .CreateKeystoneAPI (manilaTest .Instance .Namespace )
1346+ DeferCleanup (keystone .DeleteKeystoneAPI , keystoneAPIName )
1347+ keystoneAPI := keystone .GetKeystoneAPI (keystoneAPIName )
1348+ keystoneAPI .Status .Region = testRegion
1349+ keystoneAPI .Status .APIEndpoints = map [string ]string {
1350+ "internal" : "http://keystone-internal-openstack.testing" ,
1351+ "public" : "http://keystone-public-openstack.testing" ,
1352+ }
1353+ Eventually (func (g Gomega ) {
1354+ g .Expect (k8sClient .Status ().Update (ctx , keystoneAPI .DeepCopy ())).Should (Succeed ())
1355+ }, timeout , interval ).Should (Succeed ())
1356+
1357+ // Trigger reconciliation
1358+ th .ExpectCondition (
1359+ manilaTest .Instance ,
1360+ ConditionGetterFunc (ManilaConditionGetter ),
1361+ condition .ServiceConfigReadyCondition ,
1362+ corev1 .ConditionTrue ,
1363+ )
1364+
1365+ configSecret := th .GetSecret (manilaTest .ManilaConfigSecret )
1366+ Expect (configSecret ).ShouldNot (BeNil ())
1367+ Expect (configSecret .Data ).Should (HaveKey ("00-config.conf" ))
1368+ configData := string (configSecret .Data ["00-config.conf" ])
1369+
1370+ // Verify region_name in [keystone_authtoken]
1371+ Expect (configData ).Should (ContainSubstring (
1372+ fmt .Sprintf ("[keystone_authtoken]\n region_name = %s" , testRegion )))
1373+
1374+ // Verify region_name in [neutron]
1375+ Expect (configData ).Should (ContainSubstring (
1376+ fmt .Sprintf ("[neutron]\n region_name = %s" , testRegion )))
1377+
1378+ // Verify region_name in [nova]
1379+ Expect (configData ).Should (ContainSubstring (
1380+ fmt .Sprintf ("[nova]\n region_name = %s" , testRegion )))
1381+
1382+ // Verify region_name in [barbican]
1383+ Expect (configData ).Should (ContainSubstring (
1384+ fmt .Sprintf ("[barbican]\n region_name = %s" , testRegion )))
1385+ })
13411386 })
13421387
13431388 When ("Manila is created with quorum queues disabled in transport secret" , func () {
0 commit comments