Skip to content

Commit

Permalink
Fix panic if no annotation is provided for rabbitmq LoadBalancer over…
Browse files Browse the repository at this point in the history
…ride

Jira: https://issues.redhat.com/browse/OSPRH-8066

Signed-off-by: Martin Schuppert <[email protected]>
  • Loading branch information
stuggi committed Sep 3, 2024
1 parent 7e84c20 commit b68e665
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/openstack/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ func reconcileRabbitMQ(

if rabbitmq.Spec.Override.Service != nil &&
rabbitmq.Spec.Override.Service.Spec.Type == corev1.ServiceTypeLoadBalancer {
if rabbitmq.Spec.Override.Service.EmbeddedLabelsAnnotations == nil {
rabbitmq.Spec.Override.Service.EmbeddedLabelsAnnotations = &rabbitmqv2.EmbeddedLabelsAnnotations{}
}
rabbitmq.Spec.Override.Service.Annotations =
util.MergeStringMaps(rabbitmq.Spec.Override.Service.Annotations,
map[string]string{networkv1.AnnotationHostnameKey: hostname})
Expand Down

0 comments on commit b68e665

Please sign in to comment.