Finalize PR 114 Configuration command to Manage System Configuration#521
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #521 +/- ##
=========================================
- Coverage 10.99% 7.04% -3.95%
=========================================
Files 173 243 +70
Lines 8671 14571 +5900
=========================================
+ Hits 953 1027 +74
- Misses 7612 13437 +5825
- Partials 106 107 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@bupd while working on this I noticed a weird issue. The settings ./bin/harbor-cli config update
Error: failed to update Harbor configurations: response status code does not match any response statuses defined for this endpoint in the swagger spec (status 400): {}Do you have any clue what could be the issue here? |
probably due to harbor not having ldap configured. 400 indicates that the body from the client side is wrong. |
|
@bupd Can I merge this one? |
@qcserestipy Please do add screenshots or a video with the changes. I will review it next week. Thanks |
bupd
left a comment
There was a problem hiding this comment.
@qcserestipy Thanks for your contributions
I have left my improvements below.
- remove the get cmd.
- improve the view command.
| Credentials []Credential `mapstructure:"credentials" yaml:"credentials"` | ||
| CurrentCredentialName string `mapstructure:"current-credential-name" yaml:"current-credential-name"` | ||
| Credentials []Credential `mapstructure:"credentials" yaml:"credentials"` | ||
| Configurations models.Configurations `mapstructure:"configurations" yaml:"configurations"` |
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.23.0 to 0.27.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.23.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
This command fetches and stores the system config in the harbor config file. Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
…r api configurationsok types; Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
…ifferent categories; todo: update from config runs into swagger api errors Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
… and update command, extend reflection for view functionality - In this commit the view command is added that supports setting categories aligned with the UI - Reflection is cleaned up to also handle secret values stored in the config file - Reflection is used for table view of configurations Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
… command to support specifiying configurations in a separate file than the harbor-cli global config Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
The get command is removed since not necessary. The view command is updated to make category selection available for piping. The apply command is adapted to not use harbor config but external config file that can be chosen via flag. Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
…tion. This function is not longer needed since the configurations settings will be stored in another file and not in the harbor credentials config file. Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: qcserestipy <patrickeschenbach96@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
735b6a2 to
b2c5ad3
Compare
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <45457307+qcserestipy@users.noreply.github.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
…oharbor#521) * build(deps): bump golang.org/x/text from 0.23.0 to 0.27.0 (goharbor#519) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.23.0 to 0.27.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.23.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * add system `config get` command This command fetches and stores the system config in the harbor config file. Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * add system config `update` command Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Rebase on main; moved command to its own package; added reflection for api configurationsok types; Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Updated get function to sort for categories; update api handler for different categories; todo: update from config runs into swagger api errors Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * .. Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * feat(configurations): Added configurations view command, clean up get and update command, extend reflection for view functionality - In this commit the view command is added that supports setting categories aligned with the UI - Reflection is cleaned up to also handle secret values stored in the config file - Reflection is used for table view of configurations Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Add Support for System-Level Robot Accounts (goharbor#507) Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Updated github.com/go-viper/mapstructure/v2 to avoid vulnerability Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Renamed config update to config apply; added -f flag for config apply command to support specifiying configurations in a separate file than the harbor-cli global config Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * feat: Remove get command, refactor view command The get command is removed since not necessary. The view command is updated to make category selection available for piping. The apply command is adapted to not use harbor config but external config file that can be chosen via flag. Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * refactor(harbor-cli): Remove add configurations to harbor config function. This function is not longer needed since the configurations settings will be stored in another file and not in the harbor credentials config file. Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * Added changes according to PR Signed-off-by: qcserestipy <patrickeschenbach96@gmail.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * docs(config): update cli docs Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * fix(mod): Patch error in go.mod missing ) Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * docs(config): update cli docs Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * fix(config): make changes to satisfy vulncheck Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * doc(config): remove messed up cli config directory Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> * fix(config): remove obsolete vscode settings folder Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com> Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: qcserestipy <patrickeschenbach96@gmail.com> Signed-off-by: Patrick Eschenbach <45457307+qcserestipy@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bupd <bupdprasanth@gmail.com>
Overview
This PR continues and extends the work started by @bupd in PR #114, adding comprehensive configuration management capabilities to Harbor CLI. The changes include a new
viewcommand, improved reflection handling, and secret management.What's Changed
🆕 New Features
harbor config viewcommand with category-based filtering aligned with Harbor UI🔧 Improvements
Technical Details
New Commands
Reflection Enhancements
The reflection system now properly handles:
ValueandEditablefieldsCategories Supported
Acknowledgments
This work builds upon the foundation laid by @bupd in PR #114. Special thanks for the initial configuration update implementation that made this enhancement possible.
Screen recording
Screen.Recording.2025-09-02.at.13.39.02.mov