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

fix noobaa uninstall process #1698

Conversation

tangledbytes
Copy link
Contributor

Signed-off-by: Utkarsh Srivastava srivastavautkarsh8097@gmail.com

Description

This PR fixes noobaa uninstall process.

NooBaa operator has started to prohibit Noobaa CR deletion by default after a BZ was created, however if spec.cleanupPolicy.allowNoobaaDeletion = true then deletion of CR is allowed. This PR sets spec.cleanupPolicy.allowNoobaaDeletion to true when StorageCluster deletion is reconciled.

Test Performed

OCS operator built from this PR was installed on a fresh openshift cluster.

  1. Run and wait for MCG components to come up
$ cat <<EOF | oc create -f -
apiVersion: ocs.openshift.io/v1
kind: StorageCluster
metadata:
  namespace: openshift-storage
  name: example-storagecluster
spec:
  manageNodes: false
  multiCloudGateway:
    reconcileStrategy: standalone
  1. Run oc delete noobaas.noobaa.io -n openshift-storage noobaa - Must result in error: rror from server: admission webhook "admissionwebhook.noobaa.io" denied the request: Deletion of NooBaa resource is prohibited
  2. Run oc delete storageclusters.ocs.openshift.io -n openshift-storage example-storagecluster - Must be able to delete the Noobaa CR.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 28, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 28, 2022

Hi @Utkarsh-pro. Thanks for your PR.

I'm waiting for a red-hat-storage member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tangledbytes
Copy link
Contributor Author

/assign umangachapagain

@umangachapagain
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 30, 2022
Copy link
Contributor

@umangachapagain umangachapagain left a comment

Choose a reason for hiding this comment

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

Put go.mod go.sum and vendor/ changes in 1st commit, hack/common.sh in 2nd commit, make gen-latest-csv changes in 3rd commit and reconciler changes in 4th commit.

We do not want to mix dependency changes with code changes.

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@tangledbytes tangledbytes force-pushed the utkarsh-pro/fix/noobaa-uninstall-process branch from 4fc6a96 to 76b7fef Compare June 2, 2022 12:37
@tangledbytes
Copy link
Contributor Author

@umangachapagain, I have a failing test here. I am not sure if it is related to this PR.

Copy link
Contributor

@umangachapagain umangachapagain left a comment

Choose a reason for hiding this comment

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

Looks good.
Please add description in commit message for "fix noobaa uninstall" and should be good to merge. You can copy the PR description.

NooBaa (MCG) operator has started prohibiting Noobaa CR deletion as a
default behaviour. Setting `spec.cleanupPolicy.allowNoobaaDeletion` to
`true` forces the operator to allow the CR deletions.

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@tangledbytes tangledbytes force-pushed the utkarsh-pro/fix/noobaa-uninstall-process branch from 76b7fef to 95f6b43 Compare June 13, 2022 11:51
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 13, 2022

@Utkarsh-pro: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/red-hat-storage-ocs-ci-e2e-aws 95f6b43 link false /test red-hat-storage-ocs-ci-e2e-aws

Full PR test history. Your PR dashboard.

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.

Copy link
Member

@jarrpa jarrpa left a comment

Choose a reason for hiding this comment

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

Love to see a good commit structure 👍

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 13, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 13, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jarrpa, utkarsh-pro

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2022
@openshift-ci openshift-ci bot merged commit a76b542 into red-hat-storage:main Jun 13, 2022
@agarwal-mudit
Copy link
Member

/cherry-pick release-4.11

@openshift-cherrypick-robot

@agarwal-mudit: #1698 failed to apply on top of branch "release-4.11":

Applying: update noobaa version to 5.11
Applying: update noobaa operator and core images
Applying: update csv to accomodate noobaa image updates
error: patch failed: deploy/csv-templates/crds/noobaa/noobaa-crd.yaml:15
error: deploy/csv-templates/crds/noobaa/noobaa-crd.yaml: patch does not apply
error: patch failed: deploy/csv-templates/noobaa-csv.yaml:2
error: deploy/csv-templates/noobaa-csv.yaml: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Using index info to reconstruct a base tree...
M	deploy/bundle/manifests/ocs-operator.clusterserviceversion.yaml
Patch failed at 0003 update csv to accomodate noobaa image updates
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.11

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.

@agarwal-mudit
Copy link
Member

@Utkarsh-pro
Do we have a 4.11 BZ for this change?
If yes then we need to backport this change there manually.

@tangledbytes
Copy link
Contributor Author

@Utkarsh-pro Do we have a 4.11 BZ for this change? If yes then we need to backport this change there manually.

@agarwal-mudit here is the BZ (for 4.11) associated with this PR.

@agarwal-mudit
Copy link
Member

@Utkarsh-pro ok, thanks. Can you create a PR to backport the fix to release-4.11 branch?

@tangledbytes
Copy link
Contributor Author

@agarwal-mudit , just to clarify: I have to create this same PR against release-4.11 branch too right?

@agarwal-mudit
Copy link
Member

@Utkarsh-pro Normally we use automated cherry-picking but when that doesn't work because of some conflict (like what is happening in this PR), we have to manually cherry pick (using cherry pick -x [commit-id]) and resolve the conflicts.

@tangledbytes
Copy link
Contributor Author

@agarwal-mudit is #1717 fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants