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

Bug when deleteNamespacedCronJob #1133

Closed
zhengyangyong opened this issue Aug 3, 2020 · 2 comments
Closed

Bug when deleteNamespacedCronJob #1133

zhengyangyong opened this issue Aug 3, 2020 · 2 comments

Comments

@zhengyangyong
Copy link

zhengyangyong commented Aug 3, 2020

kubernetes version : 1.16.4
java client version : 8.0.2

    BatchV1beta1Api batchV1beta1Api = new BatchV1beta1Api();
    V1Status status = batchV1beta1Api.deleteNamespacedCronJob(name, namespace, "true", null, null, null, null, null);

Exception Trace:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 69 column 14 path $.status
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
	at com.google.gson.Gson.fromJson(Gson.java:932)
	at com.google.gson.Gson.fromJson(Gson.java:897)
	at com.google.gson.Gson.fromJson(Gson.java:846)
	at io.kubernetes.client.openapi.JSON.deserialize(JSON.java:139)
	at io.kubernetes.client.openapi.ApiClient.deserialize(ApiClient.java:765)
	at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:968)
	at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:895)
	at io.kubernetes.client.openapi.apis.BatchV1beta1Api.deleteNamespacedCronJobWithHttpInfo(BatchV1beta1Api.java:582)
	at io.kubernetes.client.openapi.apis.BatchV1beta1Api.deleteNamespacedCronJob(BatchV1beta1Api.java:554)
@brendandburns
Copy link
Contributor

This is a duplicate of #86, there's much more detail in that issue, but basically Kubernetes can return two different types here and we only parse one of them correctly. There's not much we can do for now to fix it.

@zhengyangyong
Copy link
Author

Thanks~

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

2 participants