jetstack-secure icon indicating copy to clipboard operation
jetstack-secure copied to clipboard

refactor(cyberark): update Snapshot resource types to client.Object

Open wallrj-cyberark opened this issue 3 months ago • 0 comments

Followup to #714

This commit refactors the Snapshot resource types to use client.Object instead of runtime.Object, aiming to improve type safety. This reduces the amount of type casting and associated error handling in the minimizeSnapshot code and allows the logging of dropped secret name and namespace becasue the secret objects are known to satisfy both metav1.Object and runtime.Object. The extractResourceListFromReading function needed to be updated accordingly to handle generic types.

  • Replace runtime.Object with client.Object and *unstructured.Unstructured in Snapshot struct and related functions
  • Refactor minimizeSnapshot and isExcludableSecret to use new types
  • Update extractResourceListFromReading to use generics for resource type
  • Adjust tests to match new resource type signatures and expectations
  • Add "type" field to example Secret in input.json for clarity

wallrj-cyberark avatar Sep 13 '25 14:09 wallrj-cyberark