Skip to content

Conversation

@timmilesdw
Copy link
Contributor

@timmilesdw timmilesdw commented Dec 1, 2025

Overview

Fix "multiple readiness hooks found" false positive error during module hook registration retry.

What this PR does / why we need it

When RegisterHooks() fails after searchModuleBatchHooks() has already found a readiness hook (e.g., error in AssembleEnvironmentForModule()), the hasReadiness flag remains true while hooks.registered stays false. On retry, searchModuleBatchHooks() finds the same readiness hook again but sees hasReadiness already set to true, incorrectly reporting "multiple readiness hooks found".

Root cause: searchModuleBatchHooks() was modifying bm.hasReadiness as a side effect during the search, before registration was complete.

Fix: Refactored searchModuleBatchHooks() to be a pure function that returns hasReadiness as a separate value instead of modifying the struct field directly. The bm.hasReadiness field is now set only in RegisterHooks() after successful registration.

@timmilesdw timmilesdw force-pushed the fix/readiness-bug branch 2 times, most recently from 827920f to bd13483 Compare December 1, 2025 08:32
Signed-off-by: Timur Tuktamyshev <[email protected]>
@timmilesdw timmilesdw marked this pull request as ready for review December 1, 2025 08:34
@timmilesdw timmilesdw self-assigned this Dec 1, 2025
@timmilesdw timmilesdw added the enhancement New feature or request label Dec 1, 2025
@ldmonster ldmonster changed the title Fix/readiness bug [addon-operator] Fix/readiness bug Dec 1, 2025
@ldmonster ldmonster merged commit 7385211 into main Dec 1, 2025
8 of 9 checks passed
@ldmonster ldmonster deleted the fix/readiness-bug branch December 1, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants