Skip to content

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

Description

@mdryaan

πŸ“œ Description

controllers/controller.go, GetSlice (line 51–63) returns the raw error from c.Get(...) including IsNotFound errors. Callers in slicegateway/reconciler.go (line 122–131) handle slice == nil as the not-found case, but GetSlice never returns (nil, nil) β€” it only returns (nil, err). The slice == nil branch is dead code; a not-found Get call returns (nil, NotFoundError), which takes the error path, not the slice == nil path.

πŸ‘Ÿ Reproduction steps

  1. Call GetSlice when the slice doesn't exist yet.
  2. Observe (nil, &NotFoundError{}) β€” the slice == nil + RequeueAfter: 10*time.Second path in the slicegateway reconciler is never taken.

πŸ‘ Expected behavior

GetSlice should return (nil, nil) on IsNotFound so callers can distinguish "not found" from "API error".

πŸ‘Ž Actual Behavior

NotFound errors propagate as real errors, causing the slicegateway reconciler to return an error rather than a graceful requeue.

🐚 Relevant log output

Version

No response

πŸ–₯️ What operating system are you seeing the problem on?

No response

βœ… Proposed Solution

Add if errors.IsNotFound(err) { return nil, nil } in GetSlice.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find any similar issue

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions