SwissDataScienceCenter / amalthea

A kubernetes operator for spawning and exposing interactive user session servers.
Apache License 2.0
14 stars 4 forks source link

Secrets adoption #632

Closed sgaist closed 1 month ago

sgaist commented 1 month ago

Secret adoption is about ensuring that secrets related to the CRD are deleted when the CRD is deleted.

There are two possible implementation:

The secrets that will be used by the AmaltheaSession being created outside of the scope of this operator, setting their ownership at CRD creation time is not guaranteed to succeed as the objects might not exist yet.

Hence while the former is simpler as it gives the burden of erasing to the API server, it would require several checks to ensure all secrets are properly owned.

The latter puts the burden on the controller however it allows for the secret to appear at a later time without requiring constant checks.

Edit: Following conversation, the finalizer solution will be used.

olevski commented 1 month ago

As discussed lets use a finalizer.