[pull] main from nephio-project:main#33
Merged
Merged
Conversation
…1083) ## Bug & Fix Summary ### 1. Critical State Loss in Generic Specializer - **File:** `controllers/pkg/reconcilers/generic-specializer/reconciler.go` - **Function:** `Reconcile` **Bug:** An early return (`return ctrl.Result{}, nil`) was triggered when a package reached the *Ready* state. This caused the reconciliation flow to exit before calling `r.porchClient.Update(ctx, prr)`. **Impact:** All in-memory specialization data (e.g., IP allocations, VLAN assignments, and KRM function outputs) was never persisted to the API server. As a result: - Allocated resources were effectively “lost” - Backend systems experienced resource leaks - The controller entered repeated reconciliation loops because the package appeared unspecialized in persistent state **Fix:** - Removed the premature return to ensure the final state is always persisted via `Update` - Fixed a `log.Error(err, ...)` call that could receive a `nil` error when handling missing Kptfile cases --- ### 2. Resource Mutation Loss in Network Reconciler - **File:** `controllers/pkg/reconcilers/network/reconciler.go` - **Functions:** `getNewResources`, `applyInitialresources` **Bug:** The `Resources` collection was being passed by value to helper functions. This resulted in mutations (e.g., `res.AddNewResource(o)`) being applied only to a local copy instead of the original collection. **Impact:** Newly generated network configurations were silently dropped before reaching the final `APIApply` stage, leading to incomplete or missing infrastructure setup. **Fix:** - Updated function signatures to pass `*resources.Resources` (by pointer) - Ensured all mutations are applied to the shared collection and correctly persisted --- ### 3. Controller Manager Dependency Reversion - **File:** `operators/nephio-controller-manager/go.mod` **Issue:** The `controllers/pkg` dependency had been unintentionally downgraded to an older 2023 version, risking API incompatibility and regression of newer features. **Impact:** - Potential mismatches between controller logic and dependency APIs - Increased risk of subtle runtime errors and unstable builds **Fix:** - Restored dependency to `v0.0.0-20250915052103-2af16ab1c9e2` - Ran `go mod tidy` to ensure a clean and consistent module state --- ## Final Impact These changes restore correctness and reliability across the Nephio specialization pipeline: - Ensures all computed infrastructure state (IPs, VLANs, etc.) is **persisted reliably** - Prevents **silent state loss and backend resource leaks** - Guarantees **network reconciler applies all generated configurations** - Stabilizes dependency management and avoids unintended regressions Overall, this PR fixes critical state-handling flaws and brings the reconciliation flow back to a consistent, production-safe state. --- ## AI Tool Used **Gemini 1.5 Pro (Web Interface):** Used for codebase analysis and understanding execution flow. Signed-off-by: pulkitvats2007-crypto <pulkitvats2007@gmail.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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )