fix: consistently watch unstructured.Unstructured in real time compositions#6462
Merged
jbw976 merged 1 commit intocrossplane:mainfrom May 19, 2025
Merged
fix: consistently watch unstructured.Unstructured in real time compositions#6462jbw976 merged 1 commit intocrossplane:mainfrom
jbw976 merged 1 commit intocrossplane:mainfrom
Conversation
…itions If we watch a given XR GVK with both unstructured.Unstructured and also composed.Unstructured Go types when it itself is a composed resource, we will run into watch errors about unexpected types because the underlying watch only expects one Go type per GVK. Signed-off-by: Jared Watts <jbw976@gmail.com>
This was referenced May 19, 2025
negz
approved these changes
May 19, 2025
|
Successfully created backport PR for |
7 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of your changes
This PR updates the type we use to start watches on composed resources - we'll now use the Kubernetes
unstructured.Unstructuredtype, like we do for other watches. The current approach of usingcomposed.Unstructuredwould be fine, except that we already set up watches on XRs using theunstructured.Unstructuredtype. When an XR is itself a composed resource, we can't try to start another watch usingcomposed.Unstructured, because that is a different type than the watch we already started. When we use different types, the underlying watch runs into an unhandled error for encountering an unexpected type.The underlying root cause is described in more detail in #5957 (comment).
Fixes #5957
Fixes #6455
Because this issue was hard to reproduce and track down, I prepared a repro and testing project at https://github.com/jbw976/debug-xp-rtc-watch-error. That project consistently reproduces the issue on v1.20.0-rc.1. With this fix in place, the issue no longer occurs, e.g. the logs don't have any
Unhandled Errorentries, and all resources reach a healthy ready status:I have:
earthly +reviewableto ensure this PR is ready for review.Added or updated e2e tests.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Followed the API promotion workflow if this PR introduces, removes, or promotes an API.Need help with this checklist? See the cheat sheet.