Closed zugao closed 2 years ago
ah, good catch!
I guess in the deletion step we need to add an if
that checks if the writeConnectionSecretToRef.Name
is set, and if not, use the name that the webhook defaulter would use if unset
https://github.com/vshn/appcat-service-postgresql/blob/e0c201ca5e9ca15f2a7ea726e3034fe461c0b7ac/operator/standalone/webhook_defaulter.go#L17
Description
The deletion of postgresqlstandalone CRD is not possible when the connection secret was not created in the first place. This particular case can occur when a deletion operation is issued right after creation or in case the connection secret was not created for any other reason.
Additional Context
Connection secret is created during second reconciliation phase which means there is a time frame where the deletion is not possible with current version. When deletion happens on that particular moment, the field Name is empty thus the client returns
resource name may not be empty
error. See logs for further details.Logs
Expected Behavior
Deletion is done successfully even when the
writeConnectionSecretToRef
is not populated.Steps To Reproduce
Versions
master, latest