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

Re-create NSS CR after NSS operator upgrade in migration #2203

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

Daniel-Fan
Copy link
Contributor

Context

There is a corner case in migrate_tenant.sh where

  1. Common Service operator is upgraded to v4.x
    • So it detects its own installation mode, and clean NSS operator and CR when following requirements are all met
      • NamespaceScope Operator is at v3.x level
      • namespace-scope ConfigMap only contains one namespace or empty(single topology or all namespace mode)
      • no no-op service is requested in OperandRegistry
  2. NamespaceScope Operator is not yet upgraded
  3. All NamespaceScope CRs from CPFS v3.x are cleaned
    • So namespace-scope ConfigMap only contains one namespace.

Issue

CS operator will delete the NamespaceScope CR that are just created by the script. This will result no NamespaceScope CR in the tenant for permission projection.

[INFO] Updating the NamespaceScope object
namespacescope.operator.ibm.com/common-service created       <--------- NSS CR was created
...

# Updating ibm-namespace-scope-operator in namesapce cs2...
subscription.operators.coreos.com/ibm-namespace-scope-operator created
...

Authorizing the NamespaceScope operator in cs2 to manage namespace cp2 
...

# Accepting license for namespacescope common-service in namespace cs2...
[✗] Not found namespacescope common-service in cs2, skipping updating license acceptance     <---------- NSS CR was not found because it has been deleted by CS operator

Solution

The script will re-create the NamespaceScope CR after NSS operator is upgraded to v4.x level.
When CPFS 4.x detects NSS operator v4, it will not delete NamespaceScope CR.

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 aa80b54 into IBM:scripts-dev Sep 18, 2024
2 of 3 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