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

stop using reader in MantleRestoreReconciler #71

Merged
merged 15 commits into from
Dec 4, 2024

Conversation

ushitora-anqou
Copy link
Contributor

No description provided.

@ushitora-anqou ushitora-anqou force-pushed the avoid-using-reader branch 8 times, most recently from 0d47529 to eb1db9d Compare November 27, 2024 07:35
@ushitora-anqou ushitora-anqou marked this pull request as ready for review November 27, 2024 09:18
@ushitora-anqou ushitora-anqou force-pushed the avoid-using-reader branch 2 times, most recently from 320f305 to 333155b Compare December 2, 2024 03:06
@ushitora-anqou
Copy link
Contributor Author

@satoru-takeuchi I've fixed your points, so could you review this again?

Copy link
Contributor

@satoru-takeuchi satoru-takeuchi left a comment

Choose a reason for hiding this comment

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

I reviewed changed besides garbage_collector_runner_test.go.

cmd/controller/main.go Outdated Show resolved Hide resolved
cmd/controller/main.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
internal/controller/garbage_collector_runner_test.go Outdated Show resolved Hide resolved
@ushitora-anqou
Copy link
Contributor Author

ushitora-anqou commented Dec 3, 2024

The last commit (8571fe8) is just a kaizen and shouldn't be a functional change.

Copy link
Contributor

@satoru-takeuchi satoru-takeuchi left a comment

Choose a reason for hiding this comment

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

Almost looks good to me. I have last two change requests.

internal/controller/garbage_collector_runner.go Outdated Show resolved Hide resolved
Copy link
Contributor

@satoru-takeuchi satoru-takeuchi left a comment

Choose a reason for hiding this comment

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

LGTM. Please squash commits once the CI has passed.

Signed-off-by: Ryotaro Banno <[email protected]>
By introducing the previous commit, we cannot expect deleteRestoringPV(C)
to return an error even when the PVs or PVCs have finalizers. However,
some unit tests depend on the old behaviour. This commit fixes this
problem as follows:

- It removes all the tests that expect deleteRestoringPV(C) to return an
  error due to the finalizers.
- It fixes the tests to call deleteRestoringPV(C) without emptying the
  finalizers and expects them not to return any error.

Signed-off-by: Ryotaro Banno <[email protected]>
PVs and RBD images are now deleted asynchronously via the PV's finalizer,
so we can't expect them to be deleted immediately after deleting a PVC,
like the current e2e tests do.

This commit resolves the problem above by wrapping the checks of the
deletion of PVs and RBD images into Eventually.

Signed-off-by: Ryotaro Banno <[email protected]>
…store removal

Some of the current e2e tests expect that, when a user deletes a
MantleRestore, mantle-controller tries to remove its corresponding PVs
and RBD images, and, if it can't do so, it hinders deletion of the
MantleRestore. However, this expectation isn't appropriate anymore,
because PVs and RBD images are now removed asynchronously.

This commit fixes the problem above by amending the tests.

First, the test "It should wait while the PV/PVC is in used" is amended
as follows:

- The title is changed to "It should NOT delete an RBD image while its
  corresponding PV and PVC are in use".
- It doesn't expect mantle-controller to prevent the ManlteRestore from
  being deleted anymore, even when a Pod is using the PV and PVC created by the
  MantleRestore. Instead, it does expect the MantleRestore to be removed,
  and the PV and the RBD image NOT to be removed.
- After the pod stops using the PV, the PV and the RBD image should be
  deleted.

Second, the test "It should fail to delete the MantleRestore if failed
to remove rbd image" is removed totally. This is because we couldn't
find any effective way to simulate a failure in deleting an RBD image.

Signed-off-by: Ryotaro Banno <[email protected]>
@ushitora-anqou
Copy link
Contributor Author

@satoru-takeuchi I squashed my commits and the CI has finally passed. Could you review this again?

@satoru-takeuchi satoru-takeuchi merged commit 0ccc41e into main Dec 4, 2024
3 checks passed
@satoru-takeuchi satoru-takeuchi deleted the avoid-using-reader branch December 4, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants