Skip to content

single stage operandconfig creation#2755

Merged
Daniel-Fan merged 4 commits intoIBM:masterfrom
qpdpQ:single-stage-creation
Mar 5, 2026
Merged

single stage operandconfig creation#2755
Daniel-Fan merged 4 commits intoIBM:masterfrom
qpdpQ:single-stage-creation

Conversation

@qpdpQ
Copy link
Contributor

@qpdpQ qpdpQ commented Feb 26, 2026

What this PR does / why we need it:
CS operator previously created template OperandConfig first, then updated it with CommonService CR values. The time gap between creation and update caused race conditions with ODLM reconciliation.

This pr will merge all configurations before first OperandConfig creation, eliminating the incomplete intermediate state.

Benefits:
Single OperandConfig creation with complete configuration
No race conditions with ODLM
Reduced API calls: 2 → 1 per reconciliation
Faster time to desired state
Cleaner reconciliation logic

Which issue(s) this PR fixes:
Fixes # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/68806

@qpdpQ
Copy link
Contributor Author

qpdpQ commented Feb 26, 2026

test log:

I0226 21:19:53.781002 1 no_olm_commonservice_controller.go:160] Start to Create ODLM CR in the namespace helm
I0226 21:19:53.781018 1 no_olm_commonservice_controller.go:167] Checking if OperandRegistry and OperandConfig CRD already exist
I0226 21:19:57.836620 1 request.go:697] Waited for 1.043097276s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/ingress.operator.openshift.io/v1?timeout=32s
I0226 21:19:59.788838 1 no_olm_commonservice_controller.go:172] Installing/Updating OperandRegistry
I0226 21:19:59.829552 1 operandregistry.go:185] Updating OperandRegistry helm/common-service
I0226 21:19:59.861003 1 no_olm_commonservice_controller.go:178] Installing/Updating OperandConfig
I0226 21:19:59.924831 1 init.go:991] Merging CommonService configurations with base OperandConfig
I0226 21:19:59.924887 1 config_extractor.go:193] Extracting size configuration
I0226 21:19:59.932646 1 config_merger.go:39] Merging base OperandConfig with CommonService configurations
I0226 21:20:00.113268 1 config_merger.go:101] Successfully merged CommonService configurations with base OperandConfig
I0226 21:20:00.113341 1 init.go:998] Successfully merged configurations for single-stage OperandConfig creation
I0226 21:20:00.221385 1 init.go:664] Updating resource with name: common-service, namespace: helm, kind: OperandConfig, apiversion: operator.ibm.com/v1alpha1

@Daniel-Fan
Copy link
Contributor

Hi @qpdpQ
Could you please add some unit tests for this OperandConfig merger and validator?
This is a good reference on how to write effective test cases. https://dev.to/litmus-chaos/strategies-for-writing-more-effective-tests-in-golang-1fma

Thank you!

@qpdpQ qpdpQ force-pushed the single-stage-creation branch from 0dbeec4 to 3ea1a5a Compare March 2, 2026 14:10
qpdpQ added 2 commits March 2, 2026 06:10
Signed-off-by: Allen Li <liyuchen223@gmail.com>
Signed-off-by: Allen Li <liyuchen223@gmail.com>
@qpdpQ qpdpQ force-pushed the single-stage-creation branch from 3ea1a5a to 599940c Compare March 2, 2026 14:10
Signed-off-by: Allen Li <liyuchen223@gmail.com>
Daniel-Fan
Daniel-Fan previously approved these changes Mar 4, 2026
@Daniel-Fan Daniel-Fan dismissed their stale review March 4, 2026 16:21

Found issue with non olm controller

@Daniel-Fan
Copy link
Contributor

Hi @qpdpQ
Would you please review the changes for non OLM controller?

I saw that the changes for OLM controller is much more than the changes in non-OLM controller. Is there any redundant code that we could remove from non-OLM controller?

Thank you!

Signed-off-by: Allen Li <liyuchen223@gmail.com>
@qpdpQ
Copy link
Contributor Author

qpdpQ commented Mar 4, 2026

nice catch, I forgot to apply the same change in no-olm controller, just applied them

Copy link
Contributor

@Daniel-Fan Daniel-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes @qpdpQ

They are all looking good to me!

@Daniel-Fan Daniel-Fan merged commit 4ac61f3 into IBM:master Mar 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants