Repository navigation
Remove dead nil checks in single-concern reconcilers - #998
Merged
winiciusallan merged 2 commits intoOct 16, 2026
Merged
winiciusallan merged 2 commits into
winiciusallan merged 2 commits into
Conversation
mandre
force-pushed
the
cleanup-nil-checks-single-concern-reconcilers
branch
from
October 16, 2026 07:34
1be8c11 to
1caf10f
Compare
Collaborator
Author
Oh, that's right. I'll remove those too.
This is historical. We didn't have the generic controller, or scaffolding at first, and everything was written by hand. Assumptions that were true before no longer hold.
I'll do it here. |
The generic reconciler only calls `GetResourceReconcilers` for managed resources, and CEL validation on the CRD ensures that `spec.resource` is always set for managed resources. The nil checks for `spec.resource` in single-concern reconcilers are therefore unreachable. Also remove unit tests that exercised the now-impossible nil resource path.
The generic reconciler guards against unmanaged resources at `resource_actions.go:133` before reaching `CreateResource` at line 150. Only managed resources reach this path, and CEL validation on the CRD ensures that `spec.resource` is always set for managed resources. The nil checks are therefore unreachable. Also remove the corresponding nil checks from the scaffold template.
mandre
force-pushed
the
cleanup-nil-checks-single-concern-reconcilers
branch
from
October 16, 2026 13:23
1caf10f to
adf6163
Compare
winiciusallan
enabled auto-merge
October 16, 2026 13:46
winiciusallan
deleted the
cleanup-nil-checks-single-concern-reconcilers
branch
October 16, 2026 14:22
zunken1337
added a commit
to zunken1337/openstack-resource-controller
that referenced
this pull request
Oct 22, 2026
Available follows the recordset's Designate status (ACTIVE), polling otherwise, and status.resource.status shows it. Adoption also requires the same records. The zone is required in CreateResource and fetched in the adoption and import methods instead of in newActuator. Remove the spec.resource nil checks (k-orc#997, k-orc#998). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generic reconciler only calls
GetResourceReconcilersfor managed resources, and CEL validation on the CRD ensures thatspec.resourceis always set for managed resources. The nil checks forspec.resourcein single-concern reconcilers are therefore unreachable.