Skip to content

fix: return (nil, nil) from GetSlice on NotFound to restore graceful requeue#483

Open
mdryaan wants to merge 1 commit into
kubeslice:masterfrom
mdryaan:fix/getslice-not-found-returns-error
Open

fix: return (nil, nil) from GetSlice on NotFound to restore graceful requeue#483
mdryaan wants to merge 1 commit into
kubeslice:masterfrom
mdryaan:fix/getslice-not-found-returns-error

Conversation

@mdryaan
Copy link
Copy Markdown

@mdryaan mdryaan commented May 14, 2026

Description

controllers.GetSlice was returning (nil, NotFoundError) when the Slice CR didn't exist.The SliceGateway reconciler has a slice == nil guard at line 127 that requeues after 10 seconds — but it was dead code. GetSlice never returned (nil, nil), so a NotFound result always hit the error path and triggered exponential backoff on every gateway reconcile until
the Slice appeared.

Added an errors.IsNotFound check in GetSlice so it returns (nil, nil) on NotFound. Real API errors (permissions, timeouts, network) still propagate as before. The graceful 10s requeue path in the SliceGateway reconciler is now actually reachable.

Fixes #482

How Has This Been Tested?

  • make fmt — no formatting changes
  • make vet — no issues
  • make build — builds cleanly

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have ran go fmt
  • I have updated the helm chart as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.
  • I have verified the E2E test cases with new code changes.
  • I have added all the required E2E test cases.

Does this PR introduce a breaking change?


…ng error

Signed-off-by: mdryaan <alikhurshid842001@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: controllers.GetSlice returns error on NotFound instead of (nil, nil)

1 participant