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

Delete Cluster Scoped Resources #92

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

muralov
Copy link
Contributor

@muralov muralov commented Sep 13, 2023

  • Cluster role and binding were not deleted as k8s garbage collector cannot delete if namespace scoped owns cluster scoped
  • Add tests
  • Improve conditions

* Cluster role and binding were not deleted as k8s garbage collector cannot if namespace scoped owns cluster scoped
* Add tests
* Improve conditions
@muralov muralov requested a review from a team as a code owner September 13, 2023 07:45
@muralov muralov requested a review from grischperl September 13, 2023 07:45
@kyma-bot kyma-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 13, 2023
@muralov muralov linked an issue Sep 13, 2023 that may be closed by this pull request
2 tasks
api/v1alpha1/status.go Outdated Show resolved Hide resolved
api/v1alpha1/eventing_types.go Outdated Show resolved Hide resolved
internal/controller/eventing/controller.go Outdated Show resolved Hide resolved
internal/controller/eventing/controller.go Show resolved Hide resolved
test/utils/integration/integration.go Show resolved Hide resolved
}
eventing.Status.SetPublisherProxyConditionToFalse(
eventingv1alpha1.ConditionReasonDeleted,
eventingv1alpha1.ConditionPublisherProxyDeletedMessage)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this function be covered in the unit test as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you mean the function eventing.Status.SetPublisherProxyConditionToFalse?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm sorry, no, I meant handleEventingDeletion.

Copy link
Contributor Author

@muralov muralov Sep 14, 2023

Choose a reason for hiding this comment

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

It seems there is no unit test yet. Deletion is covered with Integration Tests.
It'd be too much if I implement now as there are multiple other cases out-of-scope. Can we separate it a follow-up issue to increase code coverage later? Anyway we need to improve int tests err cases. I wanted to write, then decided to do it later.

@@ -65,7 +65,7 @@ const (
ConditionReasonEventMeshSubManagerReady ConditionReason = "EventMeshSubscriptionManagerReady"
ConditionReasonEventMeshSubManagerFailed ConditionReason = "EventMeshSubscriptionManagerFailed"
ConditionReasonEventMeshSubManagerStopFailed ConditionReason = "EventMeshSubscriptionManagerStopFailed"
ConditionReasonEventMeshSubManagerStop ConditionReason = "Stopped"
ConditionReasonEventMeshSubManagerStopped ConditionReason = "Stopped"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The ConditionReason for all other cases is EventMeshSubscriptionManager<something>. For the sake of consistency, can we have EventMeshSubscriptionManagerStopped here?

Otherwise, if none of them need to be EventMesh specific, can the other reasons have that part removed, so it can be reused for NATS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reason stopped is actually common for NATS and EventMesh. Thus, changed to general name.

@kyma-bot kyma-bot added the lgtm Looks good to me! label Sep 15, 2023
@kyma-bot kyma-bot merged commit f66f13c into kyma-project:main Sep 15, 2023
1 check passed
@muralov muralov deleted the delete-clusterscoped-resources branch September 15, 2023 08:50
@muralov muralov linked an issue Sep 15, 2023 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprovision of resources deployed by eventing-manager
3 participants