@@ -53,6 +53,7 @@ import (
5353 clientv1 "github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1"
5454 corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1"
5555 ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
56+ placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
5657)
5758
5859var _ = Describe ("OpenStackOperator controller" , func () {
@@ -1836,6 +1837,33 @@ var _ = Describe("OpenStackOperator controller", func() {
18361837 // gomega.Expect(th.K8sClient.Create(th.Ctx, keystoneAPI.DeepCopy())).Should(gomega.Succeed())
18371838 // DeferCleanup(k8sClient.Delete, ctx, keystoneAPI)
18381839
1840+ // create cert secrets for ovn instance
1841+ DeferCleanup (k8sClient .Delete , ctx , th .CreateCertSecret (names .OVNNorthdCertName ))
1842+ DeferCleanup (k8sClient .Delete , ctx , th .CreateCertSecret (names .OVNControllerCertName ))
1843+ DeferCleanup (k8sClient .Delete , ctx , th .CreateCertSecret (names .NeutronOVNCertName ))
1844+
1845+ // create cert secrets for memcached instance
1846+ DeferCleanup (k8sClient .Delete , ctx , th .CreateCertSecret (names .MemcachedCertName ))
1847+
1848+ // enable Nova and dependencies
1849+ Eventually (func (g Gomega ) {
1850+ OSCtlplane := GetOpenStackControlPlane (names .OpenStackControlplaneName )
1851+ OSCtlplane .Spec .Nova .Enabled = true
1852+ OSCtlplane .Spec .Nova .Template = & novav1.NovaSpecCore {}
1853+ // enable "Galera, Memcached, RabbitMQ, Keystone, Glance, Neutron, Placement" too
1854+
1855+ OSCtlplane .Spec .Keystone .Enabled = true
1856+ OSCtlplane .Spec .Glance .Enabled = true
1857+ OSCtlplane .Spec .Neutron .Enabled = true
1858+ OSCtlplane .Spec .Placement .Enabled = true
1859+
1860+ if OSCtlplane .Spec .Placement .Template == nil {
1861+ OSCtlplane .Spec .Placement .Template = & placementv1.PlacementAPISpecCore {}
1862+ OSCtlplane .Spec .Placement .Template .APITimeout = 10
1863+ }
1864+ g .Expect (k8sClient .Update (ctx , OSCtlplane )).Should (Succeed ())
1865+ }, timeout , interval ).Should (Succeed ())
1866+
18391867 Eventually (func (g Gomega ) {
18401868 keystoneAPI := keystone .GetKeystoneAPI (names .KeystoneAPIName )
18411869 g .Expect (keystoneAPI ).Should (Not (BeNil ()))
@@ -1844,32 +1872,34 @@ var _ = Describe("OpenStackOperator controller", func() {
18441872 keystone .SimulateKeystoneAPIReady (names .KeystoneAPIName )
18451873
18461874 // openstackversion exists
1847- // Eventually(func(g Gomega) {
1848- // osversion := GetOpenStackVersion(names.OpenStackControlplaneName)
1849- // g.Expect(osversion).Should(Not(BeNil()))
1850-
1851- // th.ExpectCondition(
1852- // names.OpenStackVersionName,
1853- // ConditionGetterFunc(OpenStackVersionConditionGetter),
1854- // corev1.OpenStackVersionInitialized,
1855- // k8s_corev1.ConditionTrue,
1856- // )
1857- // }, timeout, interval).Should(Succeed())
1875+ Eventually (func (g Gomega ) {
1876+ osversion := GetOpenStackVersion (names .OpenStackControlplaneName )
1877+ g .Expect (osversion ).Should (Not (BeNil ()))
18581878
1859- th .CreateSecret (types.NamespacedName {Name : "openstack-config-secret" , Namespace : namespace }, map [string ][]byte {"secure.yaml" : []byte ("foo" )})
1860- th .CreateConfigMap (types.NamespacedName {Name : "openstack-config" , Namespace : namespace }, map [string ]interface {}{"clouds.yaml" : string ("foo" ), "OS_CLOUD" : "default" })
1879+ th .ExpectCondition (
1880+ names .OpenStackVersionName ,
1881+ ConditionGetterFunc (OpenStackVersionConditionGetter ),
1882+ corev1 .OpenStackVersionInitialized ,
1883+ k8s_corev1 .ConditionTrue ,
1884+ )
1885+ }, timeout , interval ).Should (Succeed ())
18611886
1862- spec := GetDefaultOpenStackControlPlaneSpec ()
1863- spec ["placement" ] = map [string ]interface {}{
1864- "enabled" : true ,
1865- }
1866- spec ["nova" ] = map [string ]interface {}{
1867- "enabled" : true ,
1868- "apiOverride" : map [string ]interface {}{"route" : map [string ]interface {}{}},
1869- "template" : map [string ]interface {}{
1870- "secret" : "osp-secret" ,
1871- },
1872- }
1887+ DeferCleanup (k8sClient .Delete , ctx ,
1888+ th .CreateSecret (types.NamespacedName {Name : "openstack-config-secret" , Namespace : namespace }, map [string ][]byte {"secure.yaml" : []byte ("foo" )}))
1889+ DeferCleanup (k8sClient .Delete , ctx ,
1890+ th .CreateConfigMap (types.NamespacedName {Name : "openstack-config" , Namespace : namespace }, map [string ]interface {}{"clouds.yaml" : string ("foo" ), "OS_CLOUD" : "default" }))
1891+
1892+ // spec := GetDefaultOpenStackControlPlaneSpec()
1893+ // spec["placement"] = map[string]interface{}{
1894+ // "enabled": true,
1895+ // }
1896+ // spec["nova"] = map[string]interface{}{
1897+ // "enabled": true,
1898+ // "apiOverride": map[string]interface{}{"route": map[string]interface{}{}},
1899+ // "template": map[string]interface{}{
1900+ // "secret": "osp-secret",
1901+ // },
1902+ // }
18731903 })
18741904
18751905 It ("should have nova and deps enabled with nova notifications bus instance configured by inheritance" , func () {
0 commit comments