fix(kuma-cp): mesh delete validation #770
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
PR https://github.com/Kong/kuma/pull/742 introduced 2 owners for Dataplane resource - Pod and Mesh. It means Dataplane will be deleted only when both Pod and Mesh are deleted. That leads to wrong behavior during scaling up and down. Offline dps are owned by Mesh and hence aren't deleted.
This PR leaves only 1 owner for Dataplane - Pod. Also this PR adds validation of Mesh during DELETE. Now it is prohibited to delete Mesh when there are any Dataplane attached to that Mesh exists.
Full changelog