tofu-controller icon indicating copy to clipboard operation
tofu-controller copied to clipboard

Use an owner reference to track which branch-planner Terraform objects belong to which original

Open squaremo opened this issue 2 years ago • 0 comments

PR #662 creates plan-only Terraform objects to represent PRs. It uses annotations (or perhaps labels) to track which objects relate to which PR. However, it doesn't track which Terraform object gave rise to these subordinate objects. Using an owner reference would have these benefits:

  • when the original Terraform object is deleted, Kubernetes will know to also delete the subordinate objects;
  • the logic for determining which Terraform objects to create and which to delete is simplified, because you can reliably just look at branch-planner objects owned by the object in question.

========

User Story:

As a Terraform Controller user, I'd like to use an owner reference to track which branch-planner Terraform objects belong to which original, so that the original Terraform object can be easily managed together with its subordinate objects.

Acceptance Criteria:

  • [ ] Branch-planner Terraform objects have owner references to the original Terraform object that gave rise to them
  • [ ] When the original Terraform object is deleted, Kubernetes automatically deletes the related subordinate objects
  • [ ] Simplify logic for determining which Terraform objects to create and delete based on owner references

squaremo avatar Jun 26 '23 16:06 squaremo