Skip to content

Conversation

@Daniel-Fan
Copy link
Contributor

@Daniel-Fan Daniel-Fan commented Mar 10, 2023

This is an enhancement for both upgrade and uninstallation experience

Context

We will append annotation into subscription to indicate the operator version and the OperandRequest requested. Following example is an OperandRequest named example-service in cloudpak-all-in-one namespace, requesting ibm-zen-operator at v3.23. channel.

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    cloudpak-all-in-one.common-service/config: 'true'
    cloudpak-all-in-one.common-service/registry: 'true'
    cloudpak-all-in-one.example-service/request: v3.23
  name: ibm-zen-operator
  namespace: cloudpak-all-in-one

However, it does not tolerate the case where there are two entires in the same OperandRequest, asking for the same operator. Here is an example in OperandRequest

  • One is ibm-zen-operator at v3.23 channel.
  • The another one is from ibm-platformui-operator at v4.0 channel.
  • Both of them are requesting for the subscription with packageName: ibm-zen-operator.
spec:
  requests:
    - operands:
        - name: ibm-im-operator
        - name: ibm-zen-operator
        - name: ibm-platformui-operator
      registry: common-service

In order to support this, we update the annotation to following format. The annotation for OperandRequest in subscription will have operator name as suffix.
<operandrequest-namespace>.<operandrequest-name>.<operator-name>/request: channel

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    cloudpak-all-in-one.common-service/config: 'true'
    cloudpak-all-in-one.common-service/registry: 'true'
    cloudpak-all-in-one.example-service.ibm-zen-operator/request: v3.23
    cloudpak-all-in-one.example-service.ibm-platformui-operator/request: v4.0
  name: ibm-zen-operator

How to reproduce the issue

  • Have current future build installed in the cluster
  • Install cs-operator and ODLM as normal

Uninstallation isse

  • Create an OperandRequest with ibm-platformui-operator
    • ibm-zen-operator was deployed at v4.0 version
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
          registry: common-service
    
  • adding ibm-zen-operator to OperandRequest
    • nothing changed as expected
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
            - name: ibm-zen-operator
          registry: common-service
    
  • remove ibm-zen-operator from OperandRequest
    • (Unexpected) zen operator was uninstalled by ODLM

Upgrade issue

  • Remove supportStatus: maintained" in OperandRegistry for ibm-zen-operator`
  • Create an OperandRequest with ibm-zen-operator
    • ibm-zen-operator was deployed at v3.23 version
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-zen-operator
          registry: common-service
    
  • Update the OperandRequest from ibm-zen-operator to ibm-platformui-operator
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
          registry: common-service
    
  • Wait for a while, subscription of ibm-zen-operator is deleted. We need to restart the ODLM pod to bring it back.

How to verify the fix

  • Have current future build installed in the cluster
  • Install cs-operator and ODLM as normal
  • replace ODLM image in CSV with quay.io/opencloudio/odlm:36ab76ec-dirty

Uninstallation isse

  • Create an OperandRequest with ibm-platformui-operator
    • ibm-zen-operator was deployed at v4.0 version
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
          registry: common-service
    
  • adding ibm-zen-operator to OperandRequest
    • nothing changed as expected
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
            - name: ibm-zen-operator
          registry: common-service
    
  • remove ibm-zen-operator from OperandRequest
    • (Expected) nothing changed as expected.

Upgrade issue

  • Remove supportStatus: maintained" in OperandRegistry for ibm-zen-operator`
  • Create an OperandRequest with ibm-zen-operator
    • ibm-zen-operator was deployed at v3.23 version
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-zen-operator
          registry: common-service
    
  • Update the OperandRequest from ibm-zen-operator to ibm-platformui-operator
    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: example-service
      namespace: cloudpak-all-in-one
    spec:
      requests:
        - operands:
            - name: ibm-platformui-operator
          registry: common-service
    
  • subscription of ibm-zen-operator will NEVER be deleted

in one OperandRequest

Signed-off-by: Daniel Fan <[email protected]>
Signed-off-by: Daniel Fan <[email protected]>
@ibm-ci-bot ibm-ci-bot requested review from bluzarraga and qpdpQ March 10, 2023 23:29
@ibm-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Details 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

@ibm-ci-bot
Copy link
Contributor

@Daniel-Fan: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
check-operand-deployment-lifecycle-manager 0c4d11d link /test check-operand-deployment-lifecycle-manager
Details

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/test-infra repository. I understand the commands that are listed here.

@Daniel-Fan Daniel-Fan closed this Mar 11, 2023
@Daniel-Fan
Copy link
Contributor Author

Replaced by #907

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.

2 participants