Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ODLM CRs after ODLM is upgraded to desired version #2280

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

Daniel-Fan
Copy link
Contributor

What this PR does / why we need it:
CS operator should wait ODLM to be upgraded, which will bring new schema for the ODLM CRDs before CS operator apply the latest OperandRegistry and OperandConfig CRs. Otherwise, it is possible that new field in ODLM CRs is pruned by old CRDs.

  1. After ODLM is upgraded to desired version via waitOperatorCSV func, the OperandRegistry and OperandConfig will be refreshed.
  2. Improve function waitOperatorCSV to get the subscription by name first, because there is a chance that the label added by OLM is not immediately available.

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

Issue reproduced

  1. Install Dev build of CPFS
  2. Observe the logs that it does not refresh OperandRegistry and OperandConfig after waiting for ODLM to be ready
I1030 15:14:15.251426 1 init.go:211] Checking if OperandRegistry and OperandConfig CRD already exist
I1030 15:14:16.851878 1 request.go:601] Waited for 1.595369734s due to client-side throttling, not priority and fairness, request: GET:[https://172.30.0.1:443/apis/monitoring.coreos.com/v1beta1?timeout=32s](https://172.30.0.1/apis/monitoring.coreos.com/v1beta1?timeout=32s)
I1030 15:14:20.856764 1 init.go:218] Checking OperandRegistry and OperandConfig deployment status
I1030 15:14:23.770390 1 init.go:228] Installing/Updating OperandRegistry
I1030 15:14:24.286940 1 init.go:233] Installing/Updating OperandConfig
I1030 15:14:24.317649 1 init.go:239] Installing ODLM Operator
I1030 15:14:24.321856 1 init.go:491] Fetch Subscription: openshift-operators/operand-deployment-lifecycle-manager-app
I1030 15:14:24.325400 1 init.go:244] Waiting for ODLM Operator to be ready
I1030 15:14:24.325415 1 init.go:1899] Waiting for the operator CSV with packageManifest ibm-odlm in namespace openshift-operators to be installed
I1030 15:14:26.875989 1 request.go:601] Waited for 2.547536227s due to client-side throttling, not priority and fairness, request: GET:[https://172.30.0.1:443/apis/infrastructure.cluster.x-k8s.io/v1beta1?timeout=32s](https://172.30.0.1/apis/infrastructure.cluster.x-k8s.io/v1beta1?timeout=32s)
I1030 15:14:29.929772 1 init.go:1160] Checking if resource Issuer CRD exsits
I1030 15:14:32.731539 1 init.go:1168] Skiped deploying Issuer, it is not exist in cluster

Test with fix applied

  1. Delete default generated ODLM CRs and ODLM operators for the above build
  2. Replace CS operator image to quay.io/daniel_fan/common-service-operator-amd64:dev and change ImagePullPolicy to `Always
  3. The CS operator pod will be automatically re-generated
  4. Observe the logs that it refreshes OperandRegistry and OperandConfig after waiting for ODLM to be ready
I1030 19:35:16.038130 1 init.go:211] Checking if OperandRegistry and OperandConfig CRD already exist
I1030 19:35:21.643753 1 init.go:218] Checking OperandRegistry and OperandConfig deployment status
I1030 19:35:21.649772 1 init.go:228] Installing/Updating OperandRegistry
I1030 19:35:21.679304 1 init.go:233] Installing/Updating OperandConfig
I1030 19:35:21.769949 1 init.go:239] Installing ODLM Operator
I1030 19:35:21.778758 1 init.go:244] Waiting for ODLM Operator to be ready
I1030 19:35:21.778781 1 init.go:1899] Waiting for the operator CSV with packageManifest ibm-odlm in namespace openshift-operators to be installed
I1030 19:35:21.781701 1 init.go:1905] The operator CSV with packageManifest ibm-odlm in namespace openshift-operators is not installed yet
I1030 19:35:26.786944 1 init.go:1905] The operator CSV with packageManifest ibm-odlm in namespace openshift-operators is not installed yet
I1030 19:35:32.836016 1 request.go:601] Waited for 1.046011871s due to client-side throttling, not priority and fairness, request: GET:[https://172.30.0.1:443/apis/performance.openshift.io/v1alpha1?timeout=32s](https://172.30.0.1/apis/performance.openshift.io/v1alpha1?timeout=32s)
I1030 19:35:37.397047 1 init.go:267] Installing/Updating OperandRegistry
I1030 19:35:37.406503 1 init.go:428] Updating resource with name: common-service, namespace: ibm-common-services, kind: OperandRegistry, apiversion: operator.ibm.com/v1alpha1
I1030 19:35:37.415532 1 init.go:272] Installing/Updating OperandConfig

…rst. If the subscription does not exist, list subscription via package manifest label

Signed-off-by: Daniel Fan <[email protected]>
Copy link
Contributor

@YCShen1010 YCShen1010 left a comment

Choose a reason for hiding this comment

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

/lgtm

@ibm-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Daniel-Fan, YCShen1010

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Daniel-Fan,YCShen1010]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibm-ci-bot ibm-ci-bot merged commit b5082d3 into IBM:release-sc2 Oct 31, 2024
5 of 9 checks passed
Daniel-Fan added a commit to Daniel-Fan/ibm-common-service-operator that referenced this pull request Nov 1, 2024
* Update ODLM CRs after ODLM is upgraded to desired version

Signed-off-by: Daniel Fan <[email protected]>

* Optimize func waitOperatorCSV by getting the subscription via name first. If the subscription does not exist, list subscription via package manifest label

Signed-off-by: Daniel Fan <[email protected]>

---------

Signed-off-by: Daniel Fan <[email protected]>
ibm-ci-bot pushed a commit that referenced this pull request Nov 1, 2024
)

* Update ODLM CRs after ODLM is upgraded to desired version



* Optimize func waitOperatorCSV by getting the subscription via name first. If the subscription does not exist, list subscription via package manifest label



---------

Signed-off-by: Daniel Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants