-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CustomResourceDefinitions: withResourceVersion() causes NoSuchMethodError #1099
Comments
FYI I have worked around this issue using a series of reflection hacks. |
My workaround leads to a strange interaction with Briefly, my workaround uses various horrible reflection hacks to call the actually existing constructor in In so doing, I see that the Then, in the bowels of But sometimes Unfortunately then this key is prefixed with various I wonder: is there a particular reason that |
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
@ljnelson I hit the same problem as you do. Custom kinds get registered without API version and are basically unusable. My initial test was successful because I happened to use the kind "Job", which I guess exists in other packages. |
@xguerin You may wish to look at how I worked around the issue. |
Interestingly I am using your Controller ;) I’ll do some more digging and look at your workaround, but I half expected to be using it already. |
@xguerin Ah; then yes, the workaround for this issue I list above is already in play. You'll also need to do something like this suitably early:
|
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
… causes NoSuchMethodError
Excellent question. I'll update to a release post aug 28th and let you know. |
I am still on this. I am synchronizing with @ljnelson to check if both of our use cases got fixed. |
Sorry for the delay; crawling back after the holidays! |
@rohanKanojia I was able to test 4.1.1 and unfortunately the problem does not seem to be solved. Here is the kind of error I am getting:
The only way to make it work is to keep @ljnelson 's workaround. |
@xguerin : ah, okay. Let me take this up myself |
@xguerin I'm not sure which workaround you have in mind. CustomResourceDefinitionNames names = new CustomResourceDefinitionNames();
names.setSingular("export");
names.setPlural("exports");
names.setKind("Export");
CustomResourceDefinitionSpec spec = new CustomResourceDefinitionSpec();
spec.setNames(names);
spec.setGroup("my.controller.com");
spec.setVersion("v1alpha1");
spec.setScope("Namespaced");
CustomResourceDefinition customResourceDefinition = new CustomResourceDefinition();
customResourceDefinition.setSpec(spec);
KubernetesDeserializer.registerCustomKind("my.controller.com/v1alpha1", "Export", Export.class);
new DefaultKubernetesClient().customResource(customResourceDefinition, Export.class, ExportList.class, DoneableExport.class)
.inNamespace("test").watch(new ExportWatcher()); |
Ahhhhh, ok. I think that detail was not abundantly clear in my head. Thanks for clarifying! |
|
I think we should move it from there #1285 |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
I'll work over the next few days to get a reproducer, but I'm following the general example code in
CRDExample.java
.I'm using
kubernetes-client
3.2.0 andkubernetes-model
2.1.1.I have a custom resource definition and a
CustomResource
of typeFoo
. I have aMixedOperation<Foo, FooList, DoneableFoo, Resource<Foo, DoneableFoo>>
instance in my hand that resulted from invokingclient.customResources(fooCrd, Foo.class, FooList.class, DoneableFoo.class)
.Now instead of calling
list()
right away on it, I callwithResourceVersion(0)
in my particular use case (which for whatever it's worth is building out the Java equivalent of the Kubernetes-nativetools/cache
package). (Note that the Go code does the equivalent.)With non-custom resources this
withResourceVersion(0)
invocation followed by a.list()
invocation works just fine.With custom resources, though, I see this (edited) stack:
The problem is at line 682 in
BaseOperation.java
. As you can clearly see, there is no such constructor inCustomResourceOperationsImpl.java
.The text was updated successfully, but these errors were encountered: