Fix: make harbor registry update non-interactive when flags are provided#901
Fix: make harbor registry update non-interactive when flags are provided#901rakshityadav1868 wants to merge 6 commits into
Conversation
Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
NucleoFusion
left a comment
There was a problem hiding this comment.
I dont think this is the best way to do it,
please refer to other commands where we do the same, and how it happens there.
Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
|
@NucleoFusion |
Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
|
@NucleoFusion |
NucleoFusion
left a comment
There was a problem hiding this comment.
Okay so, in the case of this command, we were not checking flags at all
So,
Traditionally, we check the minimal flags required for the command to execute.
From the API Docs, there is no specific amount of flags that are either required or not required.
For this, it would be best to discuss in the meeting what amount of flags from the registry model
{
"name": "string",
"description": "string",
"url": "string",
"credential_type": "string",
"access_key": "string",
"access_secret": "string",
"insecure": true
}we consider to be required, and what we dont.
This may even end up amending how we currently process the model
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #901 +/- ##
=========================================
- Coverage 10.99% 9.33% -1.66%
=========================================
Files 173 321 +148
Lines 8671 16099 +7428
=========================================
+ Hits 953 1503 +550
- Misses 7612 14462 +6850
- Partials 106 134 +28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
|
@NucleoFusion updated the flow now for updating registry through flag requires Id as a mandatory field!! Screen.Recording.2026-06-25.at.12.08.26.AM.mp4 |
bupd
left a comment
There was a problem hiding this comment.
No, Instead of making ID mandatory i would do a roundtrip with just name to get the id if it fails i would say name is not found. and throw err msg to user.
also the direction this pr is heading is not consistent with other cmds present in the harbor-cli. I suggest @rakshityadav1868 to reconsider the implementation with how other cmds treat this behaviour before implementing.
keeping things consistent across pkgs is more important than a random fix.
Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
|
Hey @bupd, I've addressed the review feedback and aligned the implementation with the existing Harbor CLI update patterns. Changes made
|
Screen.Recording.2026-06-25.at.1.53.02.PM.mov |
Description
The
harbor registry updatecommand incorrectly opens interactive prompts even when all update values are explicitly passed through CLI flags.Type of Change
Changes Made
File:
cmd/harbor/root/registry/update.go