mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
e510ab6426247dc3895440b57e72e57a92aaa83a
fix: error handling: return nil explicitly on successful completion Several functions in pkg/meta/redis/redis.go were returning 'err' at the end of successful execution paths, which could lead to incorrect error handling when 'err' was overwritten in loops or conditionals. Changed the following functions to return nil explicitly when all operations succeed: - SearchRepos: return nil instead of err after successful loop - SearchTags: return nil instead of err after successful loop - GetRepoMeta: return nil instead of err after successful operations - GetImageMeta: return nil instead of err after successful operations - GetReferrersInfo: return nil instead of err after successful loop This ensures that when functions complete successfully, they explicitly return nil rather than relying on the last value of err, which may have been overwritten during execution. This fixes TestRedisUnreachable which was failing because SearchRepos was incorrectly returning nil error when Redis was unreachable. See failure in: https://github.com/project-zot/zot/actions/runs/19729927463/job/56528529923?pr=3599 Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
zot
zot: a production-ready vendor-neutral OCI image registry - images stored in OCI image format, distribution specification on-the-wire, that's it!
Documentation for zot is located at: https://zotregistry.dev
Code of conduct details are here.
License
Description
Languages
Go
93.6%
Shell
5.8%
Makefile
0.4%