-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Handle MySQL deletion before finalizer addition
- Move finalizer handling to beginning of reconciliation loop - Add early check for deletion without finalizer - Ensure atomic finalizer addition with requeue - Separate finalizer addition from other operations Fixes #209
- Loading branch information
1 parent
ea56e2a
commit 6a070eb
Showing
2 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Create MySQL object | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: mysql.nakamasato.com/v1alpha1 | ||
kind: MySQL | ||
metadata: | ||
name: test-mysql | ||
spec: | ||
host: localhost | ||
port: 3306 | ||
adminUser: | ||
name: root | ||
type: raw | ||
adminPassword: | ||
name: password | ||
type: raw | ||
EOF | ||
|
||
# Create MySQLUser immediately | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: mysql.nakamasato.com/v1alpha1 | ||
kind: MySQLUser | ||
metadata: | ||
name: test-user | ||
spec: | ||
mysqlName: test-mysql | ||
username: testuser | ||
password: | ||
name: userpass | ||
type: raw | ||
EOF | ||
|
||
# Delete MySQL object immediately | ||
kubectl delete mysql test-mysql | ||
|
||
# Check if MySQLUser is orphaned | ||
kubectl get mysqluser test-user -o yaml |