* Feat(#5861): Support addon dependencies version ranges
This change enables addon maintainers to define version ranges for
dependencies in an addon's metadata.yaml file.
This behavior is similar to the version range allowed in the `system`
section of the metadata file. The version range expression for
`dependencies` follows the same format as for `system`.
Example:
```yaml
dependencies:
- name: addon1
version: ">= 2.3.3, < 3.0.0"
- name: addon2
version: ">= 0.1.0, < 1.0.0"
```
When installing an addon, the behavior varies depending on whether the
dependency is already installed.
If a dependency is already installed, the installed version will be
validated against the version range, and installation will fail with an
error if there's a mismatch.
If a dependency is not installed, the version range will be used to
select the addon version to be installed. If no addon version matching
the range exists, the installation will fail with an error.
Fixes#5861
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): remove unused ctx parameter
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): Add comment for IsLocalRegistry
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): unexport AddonInfoMap
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): unexport addonInfo
Signed-off-by: Michael Russo <merusso@gmail.com>
* chore: replace map[string]addonInfo with addonInfoMap for consistency
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix: add short circuit when dependency version is not specified
Signed-off-by: Michael Russo <merusso@gmail.com>
* feat: Add test for multiple validation errors
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix: Run go mod tidy
Signed-off-by: Michael Russo <merusso@gmail.com>
* feat: add tests for ToVersionedRegistry
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix: simplify listInstalledAddons loop
Signed-off-by: Michael Russo <merusso@gmail.com>
* feat: listAvailableAddons returns addons from multiple sources
Changes:
* implement ListAddonInfo in Registry
* add interface to aid testing of listAvailableAddons
* add tests for listAvailableAddons
Signed-off-by: Michael Russo <merusso@gmail.com>
* refactor: simplify validateAddonDependencies
move logic from validateAddonDependencies to
calculateDependencyVersionToInstall.
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): Implicit memory aliasing in for loop.
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): non-wrapping format verb for fmt.Errorf
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): indent-error-flow: (revive)
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): unexported-return
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): exported type comment format (revive)
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): refactor AddonInfo to ItemInfo, avoid "stutter" (revive)
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): add comment to exported method Registry.ListAddonInfo
Signed-off-by: Michael Russo <merusso@gmail.com>
* fix(lint): fix stutter, rename AddonInfoLister to ItemInfoLister
Signed-off-by: Michael Russo <merusso@gmail.com>
* chore: Add suite tests for Registry.ListAddonInfo()
Signed-off-by: Michael Russo <merusso@gmail.com>
* Test: add test cases for addon.sortVersionsDescending
Signed-off-by: Michael Russo <merusso@gmail.com>
---------
Signed-off-by: Michael Russo <merusso@gmail.com>
* Fix: list addon commond displays only the first 20 entries when addon registry is gitlab type
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* Fix: add tips for registry addon command
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* Fix: modify the addon registry command tip
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
---------
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* chore(Makefile): Give the help information of Makefile to make it more readable
Signed-off-by: Xinwei Xiong <3293172751nss@gmail.com>
fix: Fixed some spelling mistakes
Signed-off-by: Xinwei Xiong <3293172751nss@gmail.com>
fix: part of the makefile shows a problem
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
* fix: makefile targer image-cleanup
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
* Refactor: the addon dependency installation logic is accurate to the cluster
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* Fix: optimize the code based on the review
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* Feat: add unit test for func checkDependencyNeedInstall
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
---------
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
* Feat: enhance the application synchronizer
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: e2e test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: the unit test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: the addon management APIs support the user impersonation
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: change the test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: make the impersonation feature work
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: update the document of the chart
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: enhange the workflow restful APIs
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: change the test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: the workflow record status is empty
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: change the unit test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: add some logs
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: enhance the e2e test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: add options for addon parameter
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
* Fix: wrongly report disbaled when addon is not existed
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
* Feat: support to manage the integrations by the CLI and the workflow
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: remove the xml
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: add the unit test for the nacos writer
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: add the integration API
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: make the provider commands to be deprecated
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: make the unit test work
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: rename the integration to the config
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: make the unit test cases work
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: refactor the config commands
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: add the distribution status for the config
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: sort the import packages
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: refine the code style
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: refine the code style
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: get the content format before render the content
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: add some examples
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: the command test cases
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Feat: add the definitions of the workflow step
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: add some tests
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: add some tests
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: change the name
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: retry the CI
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: refine some words
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Chore: use use fix and optimize definitions
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
* Fix: use fields instead of structs
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>