Repository navigation
Conversation
…s DWOC reconciling Signed-off-by: rmallam <rmallam@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rmallam The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @rmallam. Thanks for your PR. I'm waiting for a eclipse-che member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to preventing reconcile diffs by preserving a nil field when the input list is empty, and it includes a targeted regression unit test covering the reported empty-slice hot-loop scenario.
No open issues 🎉
What changed in this PR
Fixes an idempotency issue that caused a 1-second reconciliation hot-loop on DevWorkspaceOperatorConfig/devworkspace-config when CheCluster.spec.devEnvironments.ignoredUnrecoverableEvents is explicitly set to an empty list.
Changes:
- Keep
WorkspaceConfig.IgnoredUnrecoverableEventsasnil(not a non-nil empty slice) when the input slice is empty to avoidomitempty/diff-driven updates. - Add a unit test covering the empty-slice regression scenario.
| File | Description |
|---|---|
| pkg/deploy/devworkspace/dev_workspace_config.go | Adds a guard in updateIgnoredUnrecoverableEvents to preserve IgnoredUnrecoverableEvents as nil when the configured list is empty, preventing endless reconcile diffs. |
| pkg/deploy/devworkspace/dev_workspace_config_workspace_test.go | Adds a regression test ensuring an explicitly empty ignoredUnrecoverableEvents input results in a nil IgnoredUnrecoverableEvents field in the reconciled config. |
Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
What does this PR do?
Prevents an endless 1-second reconciliation loop on
DevWorkspaceOperatorConfig/devworkspace-configwhenCheCluster.spec.devEnvironments.ignoredUnrecoverableEventsis set to an empty slice ([]).Previously,
updateIgnoredUnrecoverableEventsassigned a non-nil empty slice ([]string{}) directly toworkspaceConfig.IgnoredUnrecoverableEvents. Because that field usesomitempty, Kubernetes strips it on persist, causingcmp.Diff(nil, []string{})to report a diff on every reconcile — which continuously updatesdevworkspace-configand starves all downstreamCheClusterreconcilers.This matches the existing guard used right below it in
updateWorkspaceServiceAccountConfigforServiceAccountTokens(Keep it nil to prevent endless reconciling), and adds a unit test covering an empty[]string{}slice.What issues does this PR fix or reference?
Fixes eclipse-che/che#24044
How to test this PR?
spec.devEnvironments.ignoredUnrecoverableEvents: []set inCheCluster, verifyche-operatorlogs no longer spamObject updated {"kind": "v1alpha1.DevWorkspaceOperatorConfig", "name": "devworkspace-config"}every second and downstream reconcilers (such asConfigMap/che) converge cleanly.PR Checklist
go test ./pkg/deploy/devworkspace/...)git commit -s)Summary by CodeRabbit