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

[release-2.12] Add MCOA status for CRD dependencies #1564

Closed
wants to merge 3 commits into from

Conversation

periklis
Copy link
Contributor

@periklis periklis commented Aug 7, 2024

The following PR is an amendment/extention to #1470 to improve the user experience when a user decides to use the new capabilities spec and in turn MCOA. Currently the MCOA internal reconciliation loop depends on a set of CustomResourceDefinitions (CRD) owned by other operator dependecies (i.e. cluster-logging-operator, opentelemetrycollector-operator). The underlying implementation checks if the CRDs exist and actually serve the required CRD versions. If any is missing the MCO status shows the MCOADegradedCondition, e.g.:

conditions:
  - lastTransitionTime: "2024-08-07T09:25:01Z"
    message: 'MultiCluster-Observability-Addon degraded because the following CRDs are not installed on this hub cluster: opentelemetrycollectors.opentelemetry.io(v1beta1)'
    reason: MultiClusterObservabilityAddonDegraded
    status: "True"
    type: MultiClusterObservabilityAddonDegraded

image

cc @JoaoBraveCoding @moadz @pavolloffay

Signed-off-by: Periklis Tsirakidis <[email protected]>
Signed-off-by: Periklis Tsirakidis <[email protected]>
Copy link
Contributor

@moadz moadz left a comment

Choose a reason for hiding this comment

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

LGTM. One question, this means we lock users into always having a CRD present if the capability is enabled correct?

My question is mostly around a potentially application/restoration of the CRD when the CRD might be absent, but the MCOA reconciliation loop will error as they are not present. I suspect this is just an acceptable edge case at this point, and it will pick it up in the next reconciliation loop.

@openshift-ci openshift-ci bot added the lgtm label Aug 7, 2024
Copy link

openshift-ci bot commented Aug 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: moadz, periklis

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:

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

Copy link

openshift-ci bot commented Aug 7, 2024

New changes are detected. LGTM label has been removed.

Signed-off-by: Periklis Tsirakidis <[email protected]>
Copy link

sonarqubecloud bot commented Aug 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
14.8% Coverage on New Code (required ≥ 70%)

See analysis details on SonarCloud

@periklis
Copy link
Contributor Author

periklis commented Aug 7, 2024

/test test-unit

Copy link

openshift-ci bot commented Aug 7, 2024

@periklis: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sonarcloud e53a945 link false /test sonarcloud
ci/prow/test-unit e53a945 link true /test test-unit
ci/prow/test-e2e e53a945 link true /test test-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

key := client.ObjectKey{Name: crdName}

err := c.Get(context.TODO(), key, crd)
if client.IgnoreAlreadyExists(err) != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why are we ignoring for AlreadyExists here?

}

if len(missing) == 0 {
removeStatusCondition(conds, reasonMCOADegraded)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't work because this function works on Type and not Reason

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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.

4 participants