6 Commits
Author SHA1 Message Date
Tesshu Flower 8a96e8e0aa 🐛 fix: preserve config reference ordering in cmainstallprogression controller (#1610)
* fix: preserve config reference ordering in cmainstallprogression controller

Replace sets.Set[ConfigReferent] with []ConfigReferent in setInstallProgression
and overrideConfigMapByAddOnConfigs. Iterating a set (Go map) produces
nondeterministic ordering when a placement has multiple configs of the same GVK,
causing spurious status patches on every reconcile and unstable config ordering
downstream to MCA status.

The fix preserves the insertion order from the CMA spec's placement configs,
matching the pattern already used by overrideConfigMapByAddOnConfigs in
pkg/addon/controllers/addonconfiguration/graph.go.

Deduplication is maintained via a containsConfigReferent helper (linear scan),
consistent with the addonconfiguration controller's containsConfig method.

Fixes: https://github.com/open-cluster-management-io/ocm/issues/1609
Signed-off-by: Tesshu Flower <tflower@redhat.com>

* test: add integration test for multi-same-GVK config reference ordering

Adds an integration test that verifies the full pipeline when a CMA placement
has two configs of the same GVK. Asserts that both CMA status
InstallProgressions and MCA status ConfigReferences reflect the configs in
the order specified in the CMA placement spec (config-first before config-second),
not in a nondeterministic order.

This exercises the full controller chain:
- cmainstallprogression controller: CMA spec -> CMA status
- addonconfiguration controller: CMA status -> MCA status

Signed-off-by: Tesshu Flower <tflower@redhat.com>

---------

Signed-off-by: Tesshu Flower <tflower@redhat.com>
2026-07-03 01:04:13 +00:00
Tesshu FlowerandClaude Sonnet 4.5 3de141b745 🐛 OCM v1beta1 mca conversion fix issue 1526 (#1527)
* CMA converted from v1alpha1 to v1beta1, ignore name=addonv1beta1.ReservedNoDefaultConfigName

Fixes: https://github.com/open-cluster-management-io/ocm/issues/1526

Signed-off-by: Tesshu Flower <tflower@redhat.com>

* test: add sentinel value filtering tests for cmainstallprogression

Add test cases to verify that the ReservedNoDefaultConfigName sentinel
value is properly filtered out from both DefaultConfigReferences and
InstallProgressions status fields.

These tests ensure that v1alpha1 CMAs with supportedConfigs but no
defaultConfig don't leak the sentinel value into status, which would
cause addons using older addon-framework versions to fail.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Tesshu Flower <tflower@redhat.com>

---------

Signed-off-by: Tesshu Flower <tflower@redhat.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-18 02:33:15 +00:00
Jian Qiu 27d0adfbf3 Move addon manager's API to v1beta1 (#1511)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2026-05-07 14:39:58 +00:00
Jian Qiu 33310619d9 🌱 use SDK basecontroller for better logging. (#1269)
* Use basecontroller in sdk-go instead for better logging

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

* Rename to fakeSyncContext

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

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-12-01 03:07:02 +00:00
Qing HaoandJoao Marcal 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 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