@@ -1791,7 +1791,66 @@ OIDCRedirectURI "{{ .KeystoneEndpointPublic }}/v3/auth/OS-FEDERATION/websso/open
17911791 }
17921792 })
17931793 })
1794-
1794+ When ("Keystone CR is built with ExtraMounts" , func () {
1795+ var keystoneExtraMountsSecretName , keystoneExtraMountsPath string
1796+ BeforeEach (func () {
1797+ spec := GetDefaultKeystoneAPISpec ()
1798+ keystoneExtraMountsPath = "/var/log/foo"
1799+ keystoneExtraMountsSecretName = "foo"
1800+ spec ["extraMounts" ] = GetExtraMounts (keystoneExtraMountsSecretName , keystoneExtraMountsPath )
1801+ DeferCleanup (
1802+ k8sClient .Delete , ctx , CreateKeystoneMessageBusSecret (namespace , "rabbitmq-secret" ))
1803+ keystone := CreateKeystoneAPI (keystoneAPIName , spec )
1804+ DeferCleanup (th .DeleteInstance , keystone )
1805+ DeferCleanup (
1806+ k8sClient .Delete , ctx , CreateKeystoneAPISecret (namespace , SecretName ))
1807+ DeferCleanup (infra .DeleteMemcached , infra .CreateMemcached (namespace , "memcached" , memcachedSpec ))
1808+ DeferCleanup (
1809+ mariadb .DeleteDBService ,
1810+ mariadb .CreateDBService (
1811+ namespace ,
1812+ GetKeystoneAPI (keystoneAPIName ).Spec .DatabaseInstance ,
1813+ corev1.ServiceSpec {
1814+ Ports : []corev1.ServicePort {{Port : 3306 }},
1815+ },
1816+ ),
1817+ )
1818+ mariadb .SimulateMariaDBAccountCompleted (keystoneAccountName )
1819+ mariadb .SimulateMariaDBDatabaseCompleted (keystoneDatabaseName )
1820+ infra .SimulateTransportURLReady (types.NamespacedName {
1821+ Name : fmt .Sprintf ("%s-keystone-transport" , keystoneAPIName .Name ),
1822+ Namespace : namespace ,
1823+ })
1824+ infra .SimulateMemcachedReady (types.NamespacedName {
1825+ Name : "memcached" ,
1826+ Namespace : namespace ,
1827+ })
1828+ th .SimulateJobSuccess (dbSyncJobName )
1829+ th .SimulateJobSuccess (bootstrapJobName )
1830+ th .SimulateDeploymentReplicaReady (deploymentName )
1831+ })
1832+ It ("Check extraMounts of the resulting Deployment" , func () {
1833+ th .SimulateDeploymentReplicaReady (deploymentName )
1834+ // Get Keystone Deployment
1835+ dp := th .GetDeployment (deploymentName )
1836+ // Check the resulting deployment fields
1837+ Expect (dp .Spec .Template .Spec .Volumes ).To (HaveLen (5 ))
1838+ Expect (dp .Spec .Template .Spec .Containers ).To (HaveLen (1 ))
1839+ // Get the keystone-api container
1840+ container := dp .Spec .Template .Spec .Containers [0 ]
1841+ // Fail if keystone-api doesn't have the right number of VolumeMounts
1842+ // entries
1843+ Expect (container .VolumeMounts ).To (HaveLen (6 ))
1844+ // Inspect VolumeMounts and make sure we have the Foo MountPath
1845+ // provided through extraMounts
1846+ for _ , vm := range container .VolumeMounts {
1847+ if vm .Name == "foo" {
1848+ Expect (vm .MountPath ).To (
1849+ ContainSubstring (keystoneExtraMountsPath ))
1850+ }
1851+ }
1852+ })
1853+ })
17951854 // Run MariaDBAccount suite tests. these are pre-packaged ginkgo tests
17961855 // that exercise standard account create / update patterns that should be
17971856 // common to all controllers that ensure MariaDBAccount CRs.
0 commit comments