Skip to content

Conversation

@fwiesel
Copy link
Contributor

@fwiesel fwiesel commented Oct 29, 2025

No description provided.

@fwiesel
Copy link
Contributor Author

fwiesel commented Oct 29, 2025

Draft, as it is untested.

@fwiesel fwiesel marked this pull request as ready for review October 30, 2025 15:27
WithValues("reason", statusCondition.Reason).
WithValues("msg", statusCondition.Message).
Info("unknown status condition")
return ctrl.Result{}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

hrm, instead returning inside the default branch, I would move it out again and remove the line 116.


if expectHypervisor {
// Abort eviction
// Retry eviction
Copy link
Contributor

Choose a reason for hiding this comment

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

It says retry, but the next reconciliation will just exit.
Also, line 204/206, where the eviction is also aborted, doesn't bubble up the error - thus introducing inconsistency. I don't see a reason to have further reconciliation via error when we don't need a backoff.

log := logger.FromContext(ctx)

hypervisor, err := openstack.GetHypervisorByName(ctx, r.computeClient, eviction.Spec.Hypervisor, false)

Copy link
Contributor

Choose a reason for hiding this comment

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

just visually, the previous line is related to the error check which makes sense to put together. But it's not super important to me.

Comment on lines +517 to +521
err := r.Patch(ctx, eviction, client.MergeFromWithOptions(evictionBase, client.MergeFromWithOptimisticLock{}))
if err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this will work. We can either update the status subresource, or the metadata (finalizer), skipping the return here will almost always cause an error.

Copy link
Contributor Author

@fwiesel fwiesel Oct 31, 2025

Choose a reason for hiding this comment

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

True, I fear the rewrite will need to be more extensive then.

@fwiesel fwiesel force-pushed the GenerationChangedPredicateEviction branch from 105b0a2 to 6097c6e Compare October 31, 2025 15:51
@fwiesel fwiesel force-pushed the GenerationChangedPredicateEviction branch from 6097c6e to 3d62209 Compare October 31, 2025 16:15
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 36.14% (+3.63%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/eviction_controller.go 34.67% (-1.62%) 225 (-1) 78 (-4) 147 (+3) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/utils.go 32.61% (ø) 46 15 31

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/eviction_controller_test.go

@fwiesel
Copy link
Contributor Author

fwiesel commented Nov 20, 2025

Closing it, as we will have to revisit this one later anyway with more wide-ranging changes.

@fwiesel fwiesel closed this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants