Skip to content

Return early when notification TransportURL is not ready#1082

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
auniyal61:OSPRH-26922-fix
Mar 6, 2026
Merged

Return early when notification TransportURL is not ready#1082
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
auniyal61:OSPRH-26922-fix

Conversation

@auniyal61
Copy link
Copy Markdown
Contributor

@auniyal61 auniyal61 commented Mar 5, 2026

When a RabbitMQ notification pod is deleted or restarted, the transporturl status changes from ready to others(creating).

This change make reconciler return early when rabbitmq status is creating or failed, this prevents empty transporturl from being propogated in configs.

Adds tests to verify same

Resolves: OSPRH-26269

))
// return early - wait for notification MQ to be ready before continuing
// to avoid propagating empty transport_url to config generation
return ctrl.Result{}, nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels liek a bug
if the transport url is not read you should aboort reconsiliation
you should not continue to reconcile without it present
weare setting NovaNotificationMQReadyCondition to false meaning the overall ready status of the nova CR will be false as well

Copy link
Copy Markdown
Contributor Author

@auniyal61 auniyal61 Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its ok to set nova condition false - yes notification is not directly affecting nova services so better not set whole nova condition false, but as user want to enable notifications but there is some issue (which should not come), so its a important messaging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the transport url is not read you should aboort reconsiliation

This return statement basically aborts the current Reconciliation. As you noted the Nova CR status is set to not ready. We are not asking for a requeue or returning an error as we don't need to explicitly schedule a retry of the reconciliation here. When the TransportURL CR status changes Nova will automatically reconcile as we are owning that resource.

Comment thread internal/controller/nova_controller.go Outdated
Comment thread internal/controller/nova_controller.go Outdated
))
// return early - wait for notification MQ to be ready before continuing
// to avoid propagating empty transport_url to config generation
return ctrl.Result{}, nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the transport url is not read you should aboort reconsiliation

This return statement basically aborts the current Reconciliation. As you noted the Nova CR status is set to not ready. We are not asking for a requeue or returning an error as we don't need to explicitly schedule a retry of the reconciliation here. When the TransportURL CR status changes Nova will automatically reconcile as we are owning that resource.

Comment thread internal/controller/nova_controller.go
@gibizer
Copy link
Copy Markdown
Contributor

gibizer commented Mar 5, 2026

I tested it locally and it resolves the unnecessary nova reconfiguration.

@auniyal61 auniyal61 force-pushed the OSPRH-26922-fix branch 2 times, most recently from ae07b33 to 1a1f812 Compare March 5, 2026 17:07
@auniyal61 auniyal61 requested a review from gibizer March 6, 2026 02:02
Copy link
Copy Markdown
Contributor

@gibizer gibizer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two small changes in the test otherwise this looks good to me

Comment thread test/functional/nova_controller_test.go Outdated
Comment thread test/functional/nova_controller_test.go Outdated
When a RabbitMQ notification pod is deleted or restarted, the transporturl status
changes from ready to others(creating).

This change make reconciler return early when rabbitmq status is
creating or failed, this prevents empty transporturl from being
propogated in configs.

Adds tests to verify same

Resolves: OSPRH-26269
Copy link
Copy Markdown
Contributor

@gibizer gibizer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks good

@openshift-ci openshift-ci Bot added the lgtm label Mar 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: auniyal61, gibizer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 320f409 into openstack-k8s-operators:main Mar 6, 2026
7 checks passed
@auniyal61 auniyal61 deleted the OSPRH-26922-fix branch March 6, 2026 12:25
@gibizer
Copy link
Copy Markdown
Contributor

gibizer commented Apr 28, 2026

/cherry-pick 18.0-fr5

@openshift-cherrypick-robot
Copy link
Copy Markdown

@gibizer: new pull request created: #1109

Details

In response to this:

/cherry-pick 18.0-fr5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants