Skip to content

[pull] main from nephio-project:main#33

Merged
pull[bot] merged 1 commit into
efiacor:mainfrom
nephio-project:main
Apr 15, 2026
Merged

[pull] main from nephio-project:main#33
pull[bot] merged 1 commit into
efiacor:mainfrom
nephio-project:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 15, 2026

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 : )

…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>
@pull pull Bot locked and limited conversation to collaborators Apr 15, 2026
@pull pull Bot added the ⤵️ pull label Apr 15, 2026
@pull pull Bot merged commit 96d44a6 into efiacor:main Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant