Repository navigation
🐛 fix(controller): clear Ready when a namespaced export fails - #387
Merged
konih merged 1 commit intoOct 1, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
A namespaced inventory left Ready=True after setInventoryDegraded, and updateStatus did not refresh Ready or Degraded when every attempted sink failed. Match the cluster reconciler on the degrade path, and mark Ready false when nothing was exported. Signed-off-by: Sebastien Tardif <[email protected]>
konih
force-pushed
the
fix/inventory-ready-on-degrade
branch
from
October 1, 2026 16:19
b35d91d to
38720e0
Compare
konih
pushed a commit
to SebTardif/Kollect
that referenced
this pull request
Oct 2, 2026
A KollectClusterInventory that was already Ready stayed Ready when one sink was inside its export interval and another write failed. isTotalExportFailure ignores that mix because DebouncedCount is non-zero, and updateStatus had no branch for failed with zero exports. The namespaced inventory learned that branch in PlatformRelay#387. The new status test failed on main with Ready still True. Signed-off-by: Sebastien Tardif <[email protected]>
konih
pushed a commit
to SebTardif/Kollect
that referenced
this pull request
Oct 2, 2026
A KollectClusterInventory that was already Ready stayed Ready when one sink was inside its export interval and another write failed. isTotalExportFailure ignores that mix because DebouncedCount is non-zero, and updateStatus had no branch for failed with zero exports. The namespaced inventory learned that branch in PlatformRelay#387. The new status test failed on main with Ready still True. Signed-off-by: Sebastien Tardif <[email protected]>
konih
pushed a commit
to SebTardif/Kollect
that referenced
this pull request
Oct 4, 2026
A KollectClusterInventory that was already Ready stayed Ready when one sink was inside its export interval and another write failed. isTotalExportFailure ignores that mix because DebouncedCount is non-zero, and updateStatus had no branch for failed with zero exports. The namespaced inventory learned that branch in PlatformRelay#387. The new status test failed on main with Ready still True. Signed-off-by: Sebastien Tardif <[email protected]>
konih
pushed a commit
that referenced
this pull request
Oct 4, 2026
A KollectClusterInventory that was already Ready stayed Ready when one sink was inside its export interval and another write failed. isTotalExportFailure ignores that mix because DebouncedCount is non-zero, and updateStatus had no branch for failed with zero exports. The namespaced inventory learned that branch in #387. The new status test failed on main with Ready still True. Signed-off-by: Sebastien Tardif <[email protected]>
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.
Summary
Clear Ready on a namespaced KollectInventory when the export fails outright, including the helper that sets Degraded directly.
Problem
setInventoryDegradedsets Synced false and Degraded true, and it used to leave Ready untouched. A watcher that treats Ready=True as healthy kept that condition across a total failure.updateStatushad two branches. Zero failures and no export error set Ready true and clear Degraded. A partial export (ExportedCount > 0) set Ready true with PartiallySynced. A total failure that also debounced (FailedCount > 0,ExportedCount == 0,DebouncedCount > 0) matched neither branch, so Ready and Degraded stayed at the previous reconcile.The cluster reconciler already removes Ready inside
setDegraded. This change is limited to the namespaced inventory reconciler. ClusterupdateStatusstill has the same missing branch.Status text uses the export error string, matching the existing per-sink messages.
Change
setInventoryDegraded.updateStatussees failures and zero exported items, set Degraded true and Ready false with reasonExportFailed. The message isoutcome.ExportErrwhen present, otherwiseexport failed.Validation
go test -count=1 ./internal/controller/ -run 'TestKollectInventoryReconciler_setInventoryDegraded|TestKollectInventoryReconciler_updateStatus_'failed inTestKollectInventoryReconciler_updateStatus_failedWithNoExportbecause Ready stayed True with reason Exported.ok github.com/platformrelay/kollect/internal/controller).golangci-lint run ./internal/controller/with the repo custom binary and Go 1.26.6 reported 0 issues.golangci-lint fmt --diffwas empty.Origin
setInventoryDegradedlanded inb40252ffd(2026-06-05). TheupdateStatusswitch landed in6b1fa364b(2026-06-05).Adjacent work in the same file, different bug: #378 (spill handling). It does not clear Ready.