fix: improve robot account config validation#770
Open
qcserestipy wants to merge 3 commits intogoharbor:mainfrom
Open
fix: improve robot account config validation#770qcserestipy wants to merge 3 commits intogoharbor:mainfrom
qcserestipy wants to merge 3 commits intogoharbor:mainfrom
Conversation
…nd. introduce schema validation for wildcard namespace in project robot. simplify scan for existing project due to inefficiency Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
=========================================
- Coverage 10.99% 7.80% -3.19%
=========================================
Files 173 270 +97
Lines 8671 13163 +4492
=========================================
+ Hits 953 1027 +74
- Misses 7612 12023 +4411
- Partials 106 113 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
Additionally, it looks like that the harbor api expects system level permissions for system robot accounts: ➜ harbor-cli git:(fix/769_robot_validation) ✗ ./bin/harbor-cli robot create -r examples/config/robot-account/system/robot-config.json -v -v
Loading configuration from: examples/config/robot-account/system/robot-config.json
DEBU[2026-03-25T20:44:29+01:00] Using system keyring
INFO[2026-03-25T20:44:29+01:00] Successfully loaded robot configuration
INFO[2026-03-25T20:44:29+01:00] Loaded system robot with 0 system permissions and 1 project-specific permissions
Error: failed to create robot: failed to create robot: bad request empty accessThis is something I will further check EDIT: There was still a bug in the code that was fixed in the next commit |
…and proceed if not Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the usability of the robot account config loading capabilities. It makes more robust validation for faulty configurations that include wrong levels or namespaces. It also introduces more clear error messages in case of wrong command usage. Furthermore, it slightly improves efficiency of config loading since inefficient full scan for existing projects is replaced with a simple get request.
Type of Change
Please select the relevant type.
Changes
Evidence