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

Support uninstallation on intra-dependency #1028

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

Daniel-Fan
Copy link
Contributor

@Daniel-Fan Daniel-Fan commented Mar 25, 2024

uninstallation issue: https://github.ibm.com/IBMPrivateCloud/roadmap/issues/62243

Context

There are several services depending on the same operator, but different operands.

For example, both IM service and Keycloak service depend on the same EDB operator. However, each of them has different EDB Cluster CR. As a result, we are using different entires in OperandRegistry/OperandConfig to distinguish EDB used by IM as common-service-postgresql, and EDB used by Keycloak as edb-keycloak

For simplicity, I will only use EDB Cluster CR as the operand created by ODLM.

  • If we request common-service-postgresql, it will install EDB operator, and EDB Cluster CR common-service-db.
  • If we request edb-keycloak, it will install EDB operator, and EDB Cluster CR keycloak-edb-cluster.

When we request both of them in the OperandRequest, they share the same EDB operator, but different EDB Cluster CRs.

During the uninstallation, following pattern should be fulfilled.

  • EDB operator would be uninstalled only when there is no common-service-postgresql and edb-keycloak requested
  • common-service-db Cluster CR should be removed as long as there is no common-service-postgresql in OperandRequest
  • keycloak-edb-cluster Cluster CR should be removed as long as there is no edb-keycloak in OperandRequest

How to test

  • Install CS 4.6 daily build in one namespace
  • Update ODLM CSV to replace image to quay.io/opencloudio/odlm:9c23dfda, and update ImagePullPolicy to Always
  • Create an OperandRequest to request both common-service-postgresql and edb-keycloak
    kind: OperandRequest
    apiVersion: operator.ibm.com/v1alpha1
    metadata:
      name: example-service
    spec:
      requests:
        - operands:
            - name: common-service-postgresql
            - name: edb-keycloak
          registry: common-service
  • Observe that there are common-service-db-1 and keycloak-edb-cluster-1 pods available, representing two EDB Cluster CR respectively.
  • Observe that there is a postgresql-operator-controller-manager pod available, representing EDB operator
  • Update OperandRequest, to remove common-service-postgresql
  • Observe that there is NO common-service-db-1 pod in the namespace.
  • Observe that there is still keycloak-edb-cluster-1 and postgresql-operator-controller-manager pod in the namespace.
  • Delete the entire OperandRequest
  • Observe that there is no more EDB related pod left in the namespace.

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>
@Daniel-Fan
Copy link
Contributor Author

/retest

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>
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 added the lgtm label Apr 2, 2024
@ibm-ci-bot ibm-ci-bot merged commit b707a0b into IBM:master Apr 2, 2024
5 checks passed
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