goharbor / goharbor/harbor-cli
fix(project): handle registry list retrieval error gracefully in create view
- Dominant language
- Go
- Stars
- 163
- Forks
- 211
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Problem
In `pkg/views/project/create/view.go`, if `getRegistryList()` fails, the entire project creation form is blocked — even though the registry selector is only needed when "Proxy Cache" is enabled. There are also unnecessary nil checks before ranging over `registries.Payload`.
## Proposed Solution
- Treat the registry list as optional: log a warning and continue if retrieval fails
- Remove unnecessary nil checks (ranging over a nil slice in Go is safe)
- Add a comment making the non-fatal intent explicit
## Affected File
- `pkg/views/project/create/view.go`
Contributor guide
Research direction
Start in pkg/views/project/create/view.go and trace how getRegistryList() is used while the project creation form is built. Confirm the registry retrieval failure path and the registries.Payload iteration. Done when retrieval failure logs a warning without blocking creation, nil checks are removed, and the non-fatal intent is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100