Skip to content

Fix: Prevent Silent Failures by Propagating KRM Function Errors in Specializers#1098

Merged
nephio-prow[bot] merged 1 commit into
nephio-project:mainfrom
pulkitvats2007-crypto:fix-specializer-krm-errors
Apr 20, 2026
Merged

Fix: Prevent Silent Failures by Propagating KRM Function Errors in Specializers#1098
nephio-prow[bot] merged 1 commit into
nephio-project:mainfrom
pulkitvats2007-crypto:fix-specializer-krm-errors

Conversation

@pulkitvats2007-crypto
Copy link
Copy Markdown
Contributor

Summary

Previously, errors from KRM function pipelines (IPAM, VLAN, Generic specializers) were logged but ignored.
This caused the controller to continue reconciliation and commit partially processed or invalid resources to Porch, while incorrectly reporting success.

This PR fixes the issue by returning errors from r.krmfn.Process(rl) directly to controller-runtime, ensuring failed reconciliations are retried and no corrupted state is committed.


Root Cause

  • Errors from KRM functions were swallowed instead of returned.
  • Controller continued execution with incomplete/invalid resources.
  • ctrl.Result{}, nil prevented retries, causing silent failures.

Fix

  • Propagate errors by returning them immediately:
_, err = r.krmfn.Process(rl)
if err != nil {
    log.Error(err, "function run failed")
    return ctrl.Result{}, errors.Wrap(err, "function run failed")
}

Applied Across

  • ipam-specializer
  • vlan-specializer
  • generic-specializer
  • specializer-reconciler

Ensures

  • No partial state is committed
  • Reconciliation stops on failure
  • controller-runtime retries with backoff

Tests

  • Added error-path unit tests for:
    • IPAM specializer
    • VLAN specializer
  • Verified:
    • Errors are returned correctly
    • No updates are made to Porch on failure
  • All tests passing: go test ./...

Impact

  • Eliminates silent failures in KRM pipelines
  • Prevents corrupted/partial GitOps state from being committed
  • Enables automatic retries for transient failures (e.g., IPAM/VLAN backend issues)
  • Improves reliability and correctness of Nephio deployments

Fixes kptdev/porch#807

Signed-off-by: pulkitvats2007-crypto <pulkitvats2007@gmail.com>
@nephio-prow
Copy link
Copy Markdown
Contributor

nephio-prow Bot commented Apr 17, 2026

Hi @pulkitvats2007-crypto. Thanks for your PR.

I'm waiting for a nephio-project member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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/test-infra repository.

@efiacor
Copy link
Copy Markdown
Collaborator

efiacor commented Apr 20, 2026

/approve
/lgtm

@nephio-prow
Copy link
Copy Markdown
Contributor

nephio-prow Bot commented Apr 20, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: efiacor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nephio-prow nephio-prow Bot added the approved label Apr 20, 2026
@nephio-prow nephio-prow Bot merged commit 4dc9123 into nephio-project:main Apr 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent Failure and State Corruption via Ignored KRM Function Pipeline Errors in Specializers

2 participants