Support uninstallation on intra-dependency #1028
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asedb-keycloak
For simplicity, I will only use EDB Cluster CR as the operand created by ODLM.
common-service-postgresql
, it will install EDB operator, and EDB Cluster CRcommon-service-db
.edb-keycloak
, it will install EDB operator, and EDB Cluster CRkeycloak-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.
common-service-postgresql
andedb-keycloak
requestedcommon-service-db
Cluster CR should be removed as long as there is nocommon-service-postgresql
in OperandRequestkeycloak-edb-cluster
Cluster CR should be removed as long as there is noedb-keycloak
in OperandRequestHow to test
quay.io/opencloudio/odlm:9c23dfda
, and update ImagePullPolicy toAlways
common-service-postgresql
andedb-keycloak
common-service-db-1
andkeycloak-edb-cluster-1
pods available, representing two EDB Cluster CR respectively.postgresql-operator-controller-manager
pod available, representing EDB operatorcommon-service-postgresql
common-service-db-1
pod in the namespace.keycloak-edb-cluster-1
andpostgresql-operator-controller-manager
pod in the namespace.