crossplane-contrib / provider-sql

An SQL provider for @crossplane
https://crossplane.io
Apache License 2.0
100 stars 57 forks source link

Keep the credentials secret when PostgreSQL Role is orphaned #178

Closed FelixLusseau closed 1 month ago

FelixLusseau commented 1 month ago

What happened ?

When I delete the Crossplane resource of a PostgreSQL Role that is in Orphan deletion policy, the secret containing the credentials is still deleted. If I recreate the resource, the secret is now empty (that is the normal behavior). Why delete the secret if the Role is configured to persist after deleting the resource ?

How can we reproduce it ?

apiVersion: postgresql.sql.crossplane.io/v1alpha1
kind: Role
metadata:
  name: user
spec:
  deletionPolicy: Orphan
  forProvider:
    privileges:
      login: true
  writeConnectionSecretToRef:
    name: my-secret
    namespace: default

Expected behavior ?

Keep the secret if the Role is orphaned.

What environment did it happen in?

Crossplane version: crossplane-1.15.2 from Helm Chart Provider version : provider-sql:v0.9.0

Thank you for your help

Duologic commented 1 month ago

I believe this is Crosplane behavior, this issue seems to address that: https://github.com/crossplane/crossplane-runtime/issues/269