Conversation
When a ResourceProvider defines linkedResourceProviders with a waitFor condition, and the linked resource cannot be found in the ResourceHandle, the manage() loop was silently skipping the waitFor check via continue. This allowed dependent resources to be created before their linked resources were ready. For linked providers without a "when" condition, the absence of the linked resource in the handle is unexpected — block creation by setting wait_for_linked_provider and log a warning. For providers with a "when" condition, the resource may have been intentionally excluded — preserve the existing skip behavior. Fixes RHDPOPS-23813.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesLinked provider handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing — further testing shows the waitFor mechanism works correctly on properly constructed claims. The original failure was caused by a different root cause (collection version pin). |
Summary
linkedResourceProvidersdefines awaitForcondition and the linked resource is not found in the ResourceHandle, themanage()loop was silently skipping the check viacontinuein thefor...elsebranchwait_for_linked_provider = True) when the linked resource is missing and nowhencondition explains its absencewhenconditions (conditional exclusion is expected)Problem
ResourceProvider configs like:
...were not blocking the dependent resource. The workload provision fired immediately, failing with undefined variable errors because the cluster wasn't ready yet.
Root cause
In
ResourceHandle.manage()(resourcehandle.py ~line 1356), thefor...elseblock that searches for the linked resource in the handle hit theelsebranch and calledcontinue, skipping to the next linked provider without settingwait_for_linked_provider = True.Test plan
test-linked-01throughtest-linked-03pass (no regression)waitForon a linked provider, verify dependent resource showswaitingFor: "Linked ResourceProvider"until the linked resource is readywhen-conditioned linked providers still work correctly (test-linked-03)Fixes RHDPOPS-23813.