rancher / fleet

Deploy workloads from Git to large fleets of Kubernetes clusters
https://fleet.rancher.io/
Apache License 2.0
1.47k stars 216 forks source link

Clean up content resources through finalizers #2566

Open weyfonk opened 1 week ago

weyfonk commented 1 week ago

Content resources may be used by one or more bundle deployments, which now each add their own finalizer on a content resource to indicate their reliance on it, and delete that finalizer when that reliance no longer applies.

This eliminates the need for batch cleanup of content resources.

Manual tests suggest that this approach is backwards compatible, having done the following:

  1. Deployed Fleet built from main
  2. Created a test GitRepo, which led to creation of a bundle deployment with its Content resource (without any finalizers)
  3. Ran helm upgrade --install updating Fleet to a version containing this refactor
  4. Saw the previously created Content resource being updated with a new finalizer
  5. Deleted the above test GitRepo, which deleted the Content resource

Refers to #2464

Open points: