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

update: removal finalizer on DSCI #1477

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Jan 6, 2025

  • do not add finalizer on DSCI during instance creation
  • only perform removal finalizer on DSCI if it has finalizer already applied (this is more for an upgrade case: if DSCI was created when we forced to add finalizer)

Description

How Has This Been Tested?

local build quay.io/wenzhou/opendatahub-operator-catalog:v2.17.20250106

  • first install old ODH build, create DSCI
  • check finalizer is added in the DSCI
  • uninstall ODH build, but not delete DSCI from cluster
  • check DSCI and bunch of servicemesh resource are still in the cluster
  • install local build
  • when installation is done
  • delete DSCI
  • check DSCI and servicemesh resources are deleted
  • create DSCI again
  • check finalizer is not added on DSCI this time, servciemesh resource are created
  • delete DSCI
  • check DSCI and servicemesh resources are deleted

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from CFSNM and etirelli January 6, 2025 11:21
Copy link

openshift-ci bot commented Jan 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zdtsw. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@zdtsw zdtsw requested review from lburgazzoli and VaishnaviHire and removed request for etirelli and CFSNM January 6, 2025 11:22
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 20.05%. Comparing base (4ed6f56) to head (f8396a8).

Files with missing lines Patch % Lines
.../dscinitialization/dscinitialization_controller.go 0.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1477      +/-   ##
==========================================
- Coverage   20.18%   20.05%   -0.13%     
==========================================
  Files         162      162              
  Lines       11147    11133      -14     
==========================================
- Hits         2250     2233      -17     
- Misses       8665     8673       +8     
+ Partials      232      227       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lburgazzoli
Copy link
Contributor

We would probably need to add an e2e test for this

@lburgazzoli
Copy link
Contributor

We would probably need to add an e2e test for this

@zdtsw are you going to add e2e tests in this PR ?

@zdtsw
Copy link
Member Author

zdtsw commented Jan 14, 2025

We would probably need to add an e2e test for this

@zdtsw are you going to add e2e tests in this PR ?

i will, once i get all other stuff done first.

@lburgazzoli
Copy link
Contributor

We would probably need to add an e2e test for this

@zdtsw are you going to add e2e tests in this PR ?

i will, once i get all other stuff done first.

ok, can we mark such PRs as a draft/WIP ?

@@ -105,38 +104,23 @@ func (r *DSCInitializationReconciler) Reconcile(ctx context.Context, req ctrl.Re
}
}

if instance.ObjectMeta.DeletionTimestamp.IsZero() {
Copy link
Contributor

Choose a reason for hiding this comment

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

if I got this right, we are not adding any finalizer, however feature handler have some explicit delete action https://github.com/opendatahub-io/opendatahub-operator/blob/main/controllers/dscinitialization/servicemesh_setup.go#L209-L214, so by removing the finalizer, I think we may enter in a conditions where those explicit delete actions are not executed successfully

Copy link
Member Author

Choose a reason for hiding this comment

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

took some time to refresh my memory,
so the OnDelete() on this case is used for:
servicemesh is Unmanaged, when user delete DSCI, we unset externalprovider in SMCP but still keep SMCP in the cluster.
but in reality, this will not happen, because

  • we do not have a management flag on authorino itself. it is created as part of enabled servicemesh or not created at all.

so if user has SMCP before ODH, then they set servicemesh to Unmanaged, we will not even patch SMCP with authorino or create authorino CR.

Copy link
Contributor

Choose a reason for hiding this comment

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

so that logic can be removed ?

Copy link
Member Author

Choose a reason for hiding this comment

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

i believe so.
it was put there for future but the future did not come

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, so maybe we have to remove it, and then remove the finalizer ?

Copy link
Member Author

Choose a reason for hiding this comment

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

#1621 track changes here for removal

Copy link
Member Author

Choose a reason for hiding this comment

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

the removal PR has been merged.

- do not add finalizer on DSCI during instance creation
- only perform removal finalizer on DSCI if it has finalizer already applied
  (this is more for an upgrade case: if DSCI was created when we forced to add finalizer)

Signed-off-by: Wen Zhou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants