fix(registry): handle missing registry lookup in delete by name#841
fix(registry): handle missing registry lookup in delete by name#841PrasunaEnumarthy wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #841 +/- ##
=========================================
- Coverage 10.99% 8.56% -2.43%
=========================================
Files 173 288 +115
Lines 8671 14446 +5775
=========================================
+ Hits 953 1237 +284
- Misses 7612 13091 +5479
- Partials 106 118 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
qcserestipy
left a comment
There was a problem hiding this comment.
This PR fixes issue, but also introduces new architectural patterns not used elsewhere in this project:
newDeleteRegistryCommand(deps ...)constructor patterndeleteRegistryDepsDI struct in command layer- mutable package-level function seam (
listRegistriesFunc) in API layer
I think this goes beyond scope of #840 and breaks local consistency (other commands do not use this style).
Can we keep this fix minimal and follow existing patterns?
- keep
DeleteRegistryCommand()style consistent with other commands - handle
GetRegistryIdByNameerror directly in current flow - add focused tests without introducing a new command-constructor/DI pattern
Hi @qcserestipy , I’ve made the requested changes... removed the DI/constructor setup, cleaned up the seam, aligned the command with existing patterns, and simplified the tests. The lint issues seem to be pre-existing (from a golangci-lint update) and aren’t related to this PR. Happy to fix them in a separate PR if you’d prefer. |
37558d7 to
b2ee3c1
Compare
qcserestipy
left a comment
There was a problem hiding this comment.
Thank you for your contribution, please adjust the code according to the comments. Please also do not change the layout of the actual command. Do now create unneeded types and do not add uneeded constructor functions. Please stick to consistent format of cobra commands as for others.
Signed-off-by: PrasunaEnumarthy <eswari.prasuna@gmail.com>
b2ee3c1 to
9a1e28a
Compare
|
@qcserestipy , thanks for the review! Sorry for the late response. I've addressed all the feedback:
|
Description
This PR fixes registry name lookup so it no longer fails silently when a registry is missing or falls beyond the first page of results.
It also updates
harbor registry delete <name>to stop immediately when name resolution fails instead of proceeding with registry ID0.Type of Change
Please select the relevant type.
Changes