diff --git a/pkg/openstack/rabbitmq.go b/pkg/openstack/rabbitmq.go index 9bc0c4fa8..550d26a4d 100644 --- a/pkg/openstack/rabbitmq.go +++ b/pkg/openstack/rabbitmq.go @@ -342,10 +342,13 @@ func reconcileRabbitMQ( } if rabbitmq.Spec.Override.Service != nil && + rabbitmq.Spec.Override.Service.Spec != nil && rabbitmq.Spec.Override.Service.Spec.Type == corev1.ServiceTypeLoadBalancer { if rabbitmq.Spec.Override.Service.EmbeddedLabelsAnnotations == nil { rabbitmq.Spec.Override.Service.EmbeddedLabelsAnnotations = &rabbitmqv2.EmbeddedLabelsAnnotations{} } + + // add annotation to register service name in dnsmasq rabbitmq.Spec.Override.Service.Annotations = util.MergeStringMaps(rabbitmq.Spec.Override.Service.Annotations, map[string]string{networkv1.AnnotationHostnameKey: hostname})