resolve the delete issue of mysqluser and psqluser #1151
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.
Closes #1142
What this PR does / why we need it:
If the username is empty in the spec of mysqluser.yaml and postgresqluser.yaml file, the user could not be successfully deleted from database.
Special notes for your reviewer:
Before the change, apply the below yaml file, that an entry with user name 'mysqluser-sample-hong1' will be created .
Use kubectl delete mysqluser, the user instance was deleted from cli but still in the database.
After the change, delete the mysqluser will be successful from both cli and database.
Before the change, apply the yaml file without specify the username.
Delete the user instance from cli, but the user still in the database.
After the change, delete operation will delete the user both from cli and database.
How does this PR make you feel:
If applicable: