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

chore: Match ExpectApplied expectation implementation with implementation from karpenter core #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeevanpuchakay
Copy link

Issue #, if available: kubernetes-sigs/karpenter#1348

Description of changes:

  1. Match ExpectApplied expectation implementation with implementation from karpenter core
  2. Current implementation creates object in #L97 but does not update it with the attributes that were originally passed to ExpectApplied.
  3. Reference - https://github.com/jeevanpuchakay/karpenter/blob/ff44f7325bf006fecf66e2a5684a7d8700e51cfd/pkg/test/expectations/expectations.go#L151-L181
  4. Currently there are no consumers to ExpectApplied method in operatorpkg.
  5. Context - This is part of a larger effort to consolidate all expectations in operatorpkg and use them in karpenter (core) package.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jeevanpuchakay jeevanpuchakay marked this pull request as ready for review January 18, 2025 08:58
@jeevanpuchakay jeevanpuchakay requested a review from a team as a code owner January 18, 2025 08:58
@jeevanpuchakay jeevanpuchakay force-pushed the fix-ExpectApplied-implementation branch from e339c5a to d100e1e Compare January 18, 2025 08:59
@@ -89,6 +89,9 @@ func ExpectApplied(ctx context.Context, c client.Client, objects ...client.Objec
GinkgoHelper()
for _, o := range objects {
current := o.DeepCopyObject().(client.Object)
statuscopy := o.DeepCopyObject().(client.Object) // Snapshot the status, since create/update may override
deletionTimestampSet := !o.GetDeletionTimestamp().IsZero()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I'm convinced by the deletionTimestamp logic that's present here -- this might have been in the karpenter implementation, but I'm not sure that this makes sense and is something that we want to pull in here

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.

2 participants