Adds more unit tests to sections that are easy to test.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Added unit tests for Kubernetes owner-reference and finalizer helper
functions to ensure correct behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->