[bug]: Registry ID Validation (Proxy Cache)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in pkg/api/project_handler.go around line 34 and reproduce the issue with harbor project create my-proxy --proxy-cache --registry-id "my-registry". Trace how the registry ID is parsed before the API request. Done means a non-numeric value stops project creation with an error instead of sending registryID 0.
Written by the indexing model from the issue text.
Description
Description
When creating a Proxy Cache project, the CLI fails to validate the --registry-id flag. If a non-numeric value is provided, the error is ignored, and the project creation proceeds with a registryID of 0, which can lead to incorrect project configurations or unexpected server errors.
Steps to Reproduce
- Run the command:
harbor project create my-proxy --proxy-cache --registry-id "my-registry" - Observe the output:
"Project created successfully"(even though the Registry ID was invalid).
Expected Behavior
The CLI should validate that the --registry-id is a valid integer before making the API request and return an error if it is not.
Actual Behavior
The parsing failure is ignored, and a value of 0 is sent to the Harbor API.
Environment
- OS: Any
- Tool version: Latest main branch
- Other relevant details: Affects logic in
pkg/api/project_handler.goline 34.
Additional Context
proof:
as you can see it should've stopped at "abc"
- Dominant language
- Go
- Stars
- 163
- Forks
- 212
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from goharbor/harbor-cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
goharbor/harbor-cli#1102 ·
-
[bug]: harbor webhook list cmd renders both interactive ui and json when format specified is json Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
goharbor/harbor-cli#1098 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
goharbor/harbor-cli#1096 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
goharbor/harbor-cli#1080 ·
-
bug status/has-approved-pr
Difficulty 1/5 Under an hour Newbie friendliness 90/100
goharbor/harbor-cli#1072 · 1 comment ·
All issues in goharbor/harbor-cli
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100