* 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>
* 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>
* 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>
* 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>