Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve check for existing resource GVK #2418

Merged
merged 1 commit into from
May 18, 2023

Conversation

lblackstone
Copy link
Member

Proposed changes

Part of the provider's preview and update logic involves checking whether a given GroupVersionKind (GVK) is registered with the Kubernetes cluster. A previous version of this check was implemented as an anonymous function in the provider's Check method. This implementation used a set to cache results of the check, but the cache was not saved between invocations, so it was adding unneccesary overhead to the check.

This change reimplements the GVK check as a reusable method, and simplifies the checking logic. We can implement a cache later if needed, but this should already be an improvement over the previous implementation.

Related issues (optional)

Part of the provider's preview and update logic involves checking whether a given GroupVersionKind (GVK) is registered with the Kubernetes cluster. A previous version of this check was implemented as an anonymous function in the provider's `Check` method. This implementation used a set to cache results of the check, but the cache was not saved between invocations, so it was adding unneccesary overhead to the check.

This change reimplements the GVK check as a reusable method, and simplifies the checking logic. We can implement a cache later if needed, but this should already be an improvement over the previous implementation.
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@lblackstone lblackstone enabled auto-merge (squash) May 18, 2023 17:22
@lblackstone lblackstone merged commit 26878ce into master May 18, 2023
18 checks passed
@lblackstone lblackstone deleted the lblackstone/gvk-exists-check branch May 18, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants