-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DynamicRESTMapper
behavior changes, can't do mapping when only resource
is set in gvr.
#2496
Comments
/kind support |
These are from the release notes of v0.15.0 which is a breaking change:
From the testing it looks like it should error if the group doesn't exist, I'm not sure if you are also hitting that when you put in the group. |
Putting in the Just to make sure whether this change would be fixed. If this breaking change meant not be fixed in the furture, we may need to plan changes in our API as well to catch up. |
I think the workaround is the new defined schema for the contract going forward in controller-runtime and not sure if they intend to go back to what used to be the behavior. What you are saying is that the new intended behavior doesn't match what used to be, but that work was the result of the breaking change moving from v0.14.6 to v0.15.x. This seems to be an enhancement honestly to make sure that the group is specified with the resource to prevent mapping multiple groups to a single "resource" and prevent naming collisions, etc.
I can't speak for the maintainers, but I don't believe that this change will go back to what used to be in older versions. |
Thanks for explaining @troy0820, it makes sense to me now to see it as an enhancement. We will plan a catch-up soon. |
The basic issue with the current restmapper is that it was purely build to be lazy in the context of how controller-runtime uses it. The upstream restmapper which we used with a thin wrapping before has all kinds of logic for what to do when it is called with incomplete input. We don't really want to duplicate that and it would be very difficult to still keep it lazy. The best suggestion I can offer at the moment is to directly use a discovery restmapper if you need it to work with less information than the full GVK. |
Thanks for the advice! |
@xuezhaojun can we close this issue? |
Closing as issue has been addressed with advice/workaround. If you need to reopen it for more clarity, please feel free. /close |
@troy0820: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Recently, we have updated
controller-runtime
fromv0.14.6
to thelatest
version, and found a behavior change ofDynamicRESTMapper
.This is the sample code, it uses
latest
version andv0.14.6
to callKindFor
:With
v0.14.6
, it returns no error.But with the
latest
code, it will return the error:Is there any workaround for this? Do we consider this as a compatibility issue?
The text was updated successfully, but these errors were encountered: