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

It is possible to use a constructor that doesn't exist when doing cascading deletion of the custom resource #1218

Closed
serrss opened this issue Sep 26, 2018 · 4 comments

Comments

@serrss
Copy link

serrss commented Sep 26, 2018

It is possible to execute the following code
client().customResources(...).withName(null).cascading(true).delete()
which will cause an error io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
In this way use a constructor that doesn't exist.

Additional information:
kubernetes-client version v4.0.5

Stacktrace:

io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred. at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:62) ~[kubernetes-client-3.1.8.jar:?] at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:53) ~[kubernetes-client-3.1.8.jar:?] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.cascading(BaseOperation.java:301) ~[kubernetes-client-3.1.8.jar:?] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.cascading(BaseOperation.java:70) ~[kubernetes-client-3.1.8.jar:?]

...
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) ~[junit-4.12.jar:4.12]

...

Caused by: java.lang.NoSuchMethodException: io.fabric8.kubernetes.client.dsl.internal.CustomResourceOperationsImpl.<init>(okhttp3.OkHttpClient, io.fabric8.kubernetes.client.Config, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, io.strimzi.api.kafka.model.KafkaTopic, java.lang.String, java.lang.Boolean, long, java.util.Map, java.util.Map, java.util.Map, java.util.Map, java.util.Map) at java.lang.Class.getConstructor0(Class.java:3082) ~[?:1.8.0_161] at java.lang.Class.getConstructor(Class.java:1825) ~[?:1.8.0_161] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.cascading(BaseOperation.java:298) ~[kubernetes-client-3.1.8.jar:?]

@ljnelson
Copy link
Contributor

Curious if this and #1099 are reporting the same thing? If so it looks like #1124 was supposed to fix this.

@serrss
Copy link
Author

serrss commented Sep 27, 2018

@ljnelson I can reproduce it for kubernetes-client version v4.0.5 that already has #1124 so I can't say that my issue with cascading deletion was fixed. Maybe we need to have the same fix as in #1124 but for Cascading?

@ppietruch
Copy link

@ljnelson I observe exactly the same issue in my code. Upgrade to v4.0.5 does not help.

@bfink13
Copy link
Contributor

bfink13 commented Jan 23, 2019

This issue is preventing CustomResource objects from being deleted because they end up with the orphan finalizer. It would appear setting .cascading(true) would prevent that from happening.

bfink13 pushed a commit to bfink13/kubernetes-client that referenced this issue Jan 23, 2019
nicolaferraro added a commit to nicolaferraro/kubernetes-client that referenced this issue Mar 6, 2019
# Conflicts:
#	CHANGELOG.md
#	kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationsImpl.java
nicolaferraro added a commit to jboss-fuse/kubernetes-client that referenced this issue Mar 6, 2019
Fix fabric8io#1218: Add cascading() override to CustomResource
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

No branches or pull requests

4 participants