GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(cyberark): update Snapshot resource types to client.Object by wallrj-cyberark · Pull Request #715 · jetstack/jetstack-secure

Conversation

@wallrj-cyberark

@wallrj-cyberark wallrj-cyberark commented Sep 13, 2025

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
wallrj-cyberark added 2 commits September 13, 2025 13:03
@wallrj-cyberark
feat(client): minimize snapshot by excluding non-clientauth TLS secrets
56dbef5
- Add minimizeSnapshot to filter out TLS secrets lacking client certificates
- Improve privacy and reduce snapshot size for CyberArk uploads
- Implement isExcludableSecret and isExcludableTLSSecret helpers
- Add unit tests for minimization and exclusion logic

Signed-off-by: Richard Wall <[email protected]>
@wallrj-cyberark
refactor(cyberark): update Snapshot resource types to client.Object
9055bfc
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

Signed-off-by: Richard Wall <[email protected]>
@wallrj-cyberark wallrj-cyberark mentioned this pull request Sep 13, 2025
[VC-43403] Minimize snapshot by filtering non-clientauth TLS secrets #714
Merged
@wallrj-cyberark
wallrj-cyberark force-pushed the client-secrets-only-2 branch from 56dbef5 to ef50cec Compare September 17, 2025 08:40
Base automatically changed from client-secrets-only-2 to master September 17, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@wallrj-cyberark
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.