26 Commits

Author SHA1 Message Date
Yang Le
f6dec25bdf add contoller to support token infrastructure (#1340)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 5m33s
Post / images (amd64, addon-manager) (push) Failing after 5m56s
Post / images (amd64, placement) (push) Failing after 55s
Post / images (amd64, registration-operator) (push) Failing after 46s
Post / images (amd64, work) (push) Failing after 44s
Post / images (arm64, addon-manager) (push) Failing after 46s
Post / images (arm64, placement) (push) Failing after 44s
Post / images (arm64, registration) (push) Failing after 47s
Post / images (arm64, registration-operator) (push) Failing after 45s
Post / images (amd64, registration) (push) Failing after 5m37s
Post / images (arm64, work) (push) Failing after 46s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Post / coverage (push) Failing after 41m15s
Close stale issues and PRs / stale (push) Successful in 7s
Signed-off-by: Yang Le <yangle@redhat.com>
2026-01-27 13:06:21 +00:00
Jian Zhu
ab41b86b8d 🐛 Use specific addon template instead of default in CSR functions (#1180)
* Upgrade addon framework

Signed-off-by: zhujian <jiazhu@redhat.com>

* Use specific addon template instead of default in CSR functions

- Pass real ManagedClusterAddOn to GetDesiredAddOnTemplate instead of nil
- Enable per-addon template selection using addon.Status.ConfigReferences
- Replace utilruntime.HandleError with explicit error returns
- Update CSRConfigurationsFunc to return ([]RegistrationConfig, error)
- Update CSRSignerFunc to return ([]byte, error)
- Add addon parameter to CSR functions for better context
- Convert runtime errors to structured logging with cluster/addon context
- Update tests to verify error conditions

This allows each ManagedClusterAddOn instance to use its specific template
configuration rather than falling back to the ClusterManagementAddon default.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* Fix error assertion logic in registration tests and improve error handling

- Fix inverted error assertion logic in TestTemplateCSRConfigurationsFunc and TestTemplateCSRSignFunc
- Change tests to properly check if expectedErr is empty vs non-empty
- When no error expected, assert err == nil; when error expected, assert err != nil and contains substring
- Fix strings.Contains argument order to check if actual error contains expected substring
- Add nil template checks with proper error messages in CSRSign and PermissionConfig functions
- Improve logging consistency with clusterName/addonName format across CSR functions
- Guard against nil pointer access by checking err == nil before calling err.Error()

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-12 06:42:44 +00:00
Jian Qiu
b72eebc72e Fix wrong key queue for addon controllers (#1152)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 54s
Post / coverage (push) Failing after 28s
Post / images (amd64, addon-manager) (push) Failing after 41s
Post / images (amd64, placement) (push) Failing after 23s
Post / images (amd64, registration) (push) Failing after 22s
Post / images (amd64, registration-operator) (push) Failing after 24s
Post / images (amd64, work) (push) Failing after 28s
Post / images (arm64, addon-manager) (push) Failing after 24s
Post / images (arm64, placement) (push) Failing after 26s
Post / images (arm64, registration) (push) Failing after 35s
Post / images (arm64, registration-operator) (push) Failing after 30s
Post / images (arm64, work) (push) Failing after 24s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 1m12s
The key queue for clustermanagementaddon informer is not correct for
several controllers, fix it by introducing a new queuekey func

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-09-01 08:51:20 +00:00
Qing Hao
2552f574a4 Fix race condition in timeout assertion test (#1124)
Some checks failed
Post / coverage (push) Failing after 40m17s
Post / images (amd64, addon-manager) (push) Failing after 9m11s
Post / images (amd64, placement) (push) Failing after 7m57s
Post / images (amd64, registration) (push) Failing after 7m45s
Post / images (amd64, registration-operator) (push) Failing after 7m47s
Post / images (amd64, work) (push) Failing after 7m59s
Post / images (arm64, addon-manager) (push) Failing after 7m51s
Post / images (arm64, placement) (push) Failing after 7m51s
Post / images (arm64, registration) (push) Failing after 7m49s
Post / images (arm64, registration-operator) (push) Failing after 7m42s
Post / images (arm64, work) (push) Failing after 8m16s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m39s
Close stale issues and PRs / stale (push) Successful in 53s
Signed-off-by: Qing Hao <qhao@redhat.com>
2025-08-13 06:08:39 +00:00
Qing Hao
c05247840a breaking change: do not add lifecycle annotation to cma and default managed by addon-manager (#856)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m21s
Post / coverage (push) Failing after 7m44s
Post / images (amd64) (push) Failing after 7m7s
Post / images (arm64) (push) Failing after 5m57s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 5s
Signed-off-by: Qing Hao <qhao@redhat.com>
2025-03-04 06:42:40 +00:00
Qing Hao
a8a40e5746 upgrade addon-framework (#828)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m24s
Post / coverage (push) Failing after 27m5s
Post / images (amd64) (push) Failing after 7m7s
Post / images (arm64) (push) Failing after 10m43s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 33s
Signed-off-by: Qing Hao <qhao@redhat.com>
2025-02-19 02:50:20 +00:00
Qing Hao
9181dbbe85 generate mca before testing rollout (#657)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-10-18 07:35:05 +00:00
Jian Qiu
8d1fdc297f Add trimmed release version to env (#648)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-10-16 04:32:19 +00:00
Qing Hao
43c3500738 upgrade framework and check configured condition in addon template (#641)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-10-09 12:53:45 +00:00
Qing Hao
851d0152a3 set configured condition in mca (#635)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-10-08 13:08:03 +00:00
Qing Hao
dfa835d674 addon: add support for multiple GVK (#585)
* addon: add support for multiple GVK

adds test cases

updates mergeAddonConfig function to match new multi same-gvk configs

Signed-off-by: Joao Marcal <jmarcal@redhat.com>

* add more UT

Signed-off-by: haoqing0110 <qhao@redhat.com>

* modify code

Signed-off-by: haoqing0110 <qhao@redhat.com>

---------

Signed-off-by: Joao Marcal <jmarcal@redhat.com>
Signed-off-by: haoqing0110 <qhao@redhat.com>
Co-authored-by: Joao Marcal <jmarcal@redhat.com>
2024-08-13 01:52:39 +00:00
Qing Hao
462992fd4c update mca progressing condition when desired and last applied matches (#513)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-06-13 06:39:26 +00:00
Qing Hao
8e792c14d8 simplify the addon progressing message (#499)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-06-12 01:24:46 +00:00
Qing Hao
ff77abd312 upgrade addon-framework (#383)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-03-28 03:15:15 +00:00
Qing Hao
22501d88f7 🌱 set cma managed by addon-manager if not configured (#374)
* set cma managed by addon-manager if not configured

Signed-off-by: haoqing0110 <qhao@redhat.com>

* update annotation in testing case

Signed-off-by: haoqing0110 <qhao@redhat.com>

* rename controller name

Signed-off-by: haoqing0110 <qhao@redhat.com>

---------

Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-03-25 04:42:58 +00:00
Qing Hao
b4bf3d0609 update the addon-framework and getSpechHash algorithm (#371)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-03-12 07:46:27 +00:00
Jian Qiu
bede3edd92 Switch to patcher in sdk-go (#349)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-01-22 02:04:49 +00:00
Qing Hao
40135fd4ba addon support rollout configs (#340)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2024-01-08 05:49:06 +00:00
Mohamed ElSerngawy
615f5a4441 Update OCM APIs and apply Rollout strategy API changes (#310)
Signed-off-by: melserngawy <melserng@redhat.com>
2023-11-16 02:36:16 +00:00
Qing Hao
c8410bfbf1 addon consume rollout helpers (#225)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2023-09-20 04:17:48 +02:00
Jian Zhu
e0d1ad384c bump golangci-lint to v1.54.2 (#270)
Signed-off-by: zhujian <jiazhu@redhat.com>
2023-09-07 15:55:12 +02:00
Qing Hao
c625fd317a 🌱 remove ClusterSet ClusterSetBinding API version v1beta1 (#257)
* update api

Signed-off-by: haoqing0110 <qhao@redhat.com>

* remove webhook

Signed-off-by: haoqing0110 <qhao@redhat.com>

* remove migration files

Signed-off-by: haoqing0110 <qhao@redhat.com>

* update api

Signed-off-by: haoqing0110 <qhao@redhat.com>

* add ut for migrationRequestFiles

Signed-off-by: haoqing0110 <qhao@redhat.com>

---------

Signed-off-by: haoqing0110 <qhao@redhat.com>
2023-08-31 16:14:11 +02:00
Jian Qiu
3167826df9 Use finalizer in api repo (#241)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-08-04 11:54:55 +02:00
Yang Le
6d6a6f1d74 🌱 upgrade addondeploymentconfigs crd to latest version (#243)
Signed-off-by: Yang Le <yangle@redhat.com>
2023-08-03 09:56:39 +02:00
Jian Qiu
e810520961 🌱 Refactor code to fix lint warning (#218)
* Refactor code to fix lint warning

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* enable lint for testing files

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-07-25 07:12:34 +02:00
Jian Zhu
a78d9f457d 🌱 Move addon manager from addon-framework to ocm repo (#196)
* update vendor to add addon-framework

Signed-off-by: zhujian <jiazhu@redhat.com>

* Move addon manager from addon-framework to ocm repo

Signed-off-by: zhujian <jiazhu@redhat.com>

* add integration tests for addon manager

Signed-off-by: zhujian <jiazhu@redhat.com>

* push addon manager image post commit

Signed-off-by: zhujian <jiazhu@redhat.com>

* use library-go to refactor addon controllers

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2023-06-27 03:59:54 +02:00