This repository was archived by the owner on Aug 12, 2024. It is now read-only.
image source: use applyconfiguration with server-side apply#559
Merged
Conversation
bdcd884 to
17b5ee4
Compare
timflannagan
approved these changes
Sep 7, 2022
Member
timflannagan
left a comment
There was a problem hiding this comment.
It would be nice to have some sort of tests to verify we're not regressing but I tested these changes out on a cluster that mutates the Pod, which passes the e2e suite, and I didn't see any immediate issues.
|
|
||
| pod := &corev1.Pod{} | ||
| op, err := i.ensureUnpackPod(ctx, bundle, pod) | ||
| fmt.Println(op, err) |
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
17b5ee4 to
9a275ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is another take on #555 that makes use of applyconfigurations and server-side apply to "apply or re-create" unpack pods.
This should solve problems that we're seeing with our existing diff comparisons where we do not handle mutations performed by unrelated webhooks.
This should be more resilient than a "hash the pod struct" approach, which is susceptible to hash changes when the Pod struct changes. This approach should theoretically not result in an unpack pod respin unless something in our apply configuration actually changed.
I tested this on a cluster that performs pod mutations and verified that Bundles are able to be successfully unpacked, and the controller does not continuously re-create the unpack pod.
Closes #560
Signed-off-by: Joe Lanford joe.lanford@gmail.com