* 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>
* 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>
* 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>
* Feat: create VelaQL views using `vela ql create`
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: format imports
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: merge reusable function
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: format import
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: make changes according to comments
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add tests for `status` or `export` fields
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: fix tests
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: fix tests
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: make changes according to comments
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: rename variables
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: search useful addon version automatically
Verify whether the current addon version meets the system version requirements according to the obtained specified version. There are two system version requirements: Vela core version, K8s version.
If meet the requirements and continue to perform the next task.
If the requirements are not met, obtain the highest version that meets the requirements
Refs #4181
Signed-off-by: HanMengnan <1448189829@qq.com>
* Fix: Optimize function implementation and code order, and modify test cases
add more comments of function
optimize package import sequence
optimize user interaction logic and error information extraction logic
Signed-off-by: HanMengnan <1448189829@qq.com>
* Fix: change template string of regular expression to const type string
Signed-off-by: HanMengnan <1448189829@qq.com>
* Feat: filter by source addon in `vela def list`
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: change header year to 2022
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: use generic filters for extensibility
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: change variable addonFilter to addonName
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: update tests according to code changes
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: unify SearchDefinition params using filters
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: simplify tests
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: remove redundant code
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add tests with multiple filters
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: show SOURCE-ADDON column in `def list`, if any
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add addon filter to apiserver definition-lists
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: fix lint issues
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Chore: update swagger doc accordingly
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add tests for filter Applying
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add a helper function to apply filters to lists
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: format imports
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add OwnerAddon to DefinitionBase
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add tests for OwnerAddon field
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add addon util tests
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: implement addon push command
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: split functions
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add command usages
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: add tests for addon push command
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Chore: fix lint
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: fix old incomplete tests
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Test: also add test in pkg/addon
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: sort import
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Refactor: add break in for loop and remove default repo checks
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: format imports
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add a cli option to keep original Chart.yaml
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: add more help text
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: fix typo in comments
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Style: add more help text
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
* Feat: add the feature that views in addon are applied independently.(#3905)
separate the deployment of views in addon and deploy them separately instead of nested in application.
see the issue for details
Refs #3905
Signed-off-by: HanMengnan <1448189829@qq.com>
* Fix: add test case of readViewFile.
Signed-off-by: HanMengnan <1448189829@qq.com>
* Fix: add the apply method of yaml view.
Signed-off-by: HanMengnan <1448189829@qq.com>
* Fix: add addon suit-test case
Signed-off-by: HanMengnan <1448189829@qq.com>