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 Jul 15, 2024
1 parent cedb5c4 commit 3e45ef6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
capabilities: Basic Install
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "true"
operatorframework.io/suggested-namespace: openstack-operators
features.operators.openshift.io/proxy-aware: "false"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
operatorframework.io/suggested-namespace: openstack-operators
operators.operatorframework.io/builder: operator-sdk-v1.26.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: openstack-operator.v0.0.0
Expand Down
3 changes: 3 additions & 0 deletions pkg/openstack/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,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 3e45ef6

Please sign in to comment.