@@ -3145,54 +3145,6 @@ var _ = Describe("OpenStackOperator Webhook", func() {
31453145 Expect (OSCtlplane .Labels ).Should (HaveKeyWithValue ("core.openstack.org/openstackcontrolplane" , "foo" ))
31463146 })
31473147
3148- It ("Enforces queueType=Quorum for new resources" , func () {
3149- spec := GetDefaultOpenStackControlPlaneSpec ()
3150- spec ["tls" ] = GetTLSPublicSpec ()
3151-
3152- DeferCleanup (
3153- th .DeleteInstance ,
3154- CreateOpenStackControlPlane (types.NamespacedName {Name : "test-new-quorum" , Namespace : namespace }, spec ),
3155- )
3156-
3157- OSCtlplane := GetOpenStackControlPlane (types.NamespacedName {Name : "test-new-quorum" , Namespace : namespace })
3158- Expect (OSCtlplane .Spec .Rabbitmq .Templates ).Should (Not (BeNil ()))
3159-
3160- // Verify that all templates get queueType=Quorum for new resources
3161- for templateName , template := range * OSCtlplane .Spec .Rabbitmq .Templates {
3162- Expect (template .QueueType ).Should (Equal ("Quorum" ), "RabbitMQ template %s should have queueType=Quorum" , templateName )
3163- }
3164- })
3165-
3166- It ("Preserves existing queueType values on updates" , func () {
3167- spec := GetDefaultOpenStackControlPlaneSpec ()
3168- spec ["tls" ] = GetTLSPublicSpec ()
3169-
3170- // Create a resource first (will get Quorum by default)
3171- ctlplane := CreateOpenStackControlPlane (types.NamespacedName {Name : "test-preserve-existing" , Namespace : namespace }, spec )
3172- DeferCleanup (th .DeleteInstance , ctlplane )
3173-
3174- // Manually set it to Mirrored to simulate existing deployment
3175- Eventually (func (g Gomega ) {
3176- existingCtlplane := GetOpenStackControlPlane (types.NamespacedName {Name : "test-preserve-existing" , Namespace : namespace })
3177- (* existingCtlplane .Spec .Rabbitmq .Templates )["rabbitmq" ] = rabbitmqv1.RabbitMqSpecCore {
3178- QueueType : "Mirrored" , // Simulate existing value
3179- }
3180- g .Expect (k8sClient .Update (ctx , existingCtlplane )).Should (Succeed ())
3181- }).Should (Succeed ())
3182-
3183- // Verify it's preserved on subsequent updates
3184- Eventually (func (g Gomega ) {
3185- updatedCtlplane := GetOpenStackControlPlane (types.NamespacedName {Name : "test-preserve-existing" , Namespace : namespace })
3186- updatedCtlplane .Spec .Secret = "updated-secret" // Trigger webhook
3187- g .Expect (k8sClient .Update (ctx , updatedCtlplane )).Should (Succeed ())
3188-
3189- // Should still be Mirrored after update
3190- finalCtlplane := GetOpenStackControlPlane (types.NamespacedName {Name : "test-preserve-existing" , Namespace : namespace })
3191- rabbitTemplate := (* finalCtlplane .Spec .Rabbitmq .Templates )["rabbitmq" ]
3192- g .Expect (rabbitTemplate .QueueType ).Should (Equal ("Mirrored" ), "Existing queueType should be preserved" )
3193- }).Should (Succeed ())
3194- })
3195-
31963148 It ("calls placement validation webhook" , func () {
31973149 spec := GetDefaultOpenStackControlPlaneSpec ()
31983150 spec ["tls" ] = GetTLSPublicSpec ()
0 commit comments