-
Notifications
You must be signed in to change notification settings - Fork 1
Blocking defect: api.deleteStack does not seem to work #2
Comments
see around line 761 in cli_1.log above |
FYI: I have also tried the old delete method as a work around, but it no longer works (gets a 404), I suspect because of version arrays in Spec now: int rc = KubeUtils.deleteKubeResource(apiClient, namespace, name, group, version, "stacks"); |
@davco01a ok a couple of things here... I have a test program: public static void main(String[] parms) {
try {
ApiClient client = Config.defaultClient();
Configuration.setDefaultApiClient(client);
V1DeleteOptions deleteOptions = new V1DeleteOptions();
deleteOptions.setGracePeriodSeconds((long)3);
deleteOptions.setOrphanDependents(true);
deleteOptions.setKind("Stacks");
deleteOptions.setApiVersion("kabanero.io/v1alpha2");
StackApi stackApi = new StackApi();
System.out.println("Attempting to delete java-microprofile stack");
V1Status status = stackApi.deleteStack("kabanero", "java-microprofile", deleteOptions, 0, true, "");
System.out.println("Return status: " + status.toString());
} catch (Throwable t) {
System.out.println("Caught an exception: " + t.toString());
t.printStackTrace(System.out);
if (t instanceof ApiException) {
ApiException ae = (ApiException) t;
System.out.println("Message: " + ae.getMessage());
System.out.println("Code: " + ae.getCode());
System.out.println("Body: " + ae.getResponseBody());
}
}
} and I am able to reproduce the 500 internal server error.
For 1) I think that there is some conflict between the If you look at the |
I've tried deleting For the V1DeleteOptions I would suggest just not setting any of these if you don't need to (just pass null). There is no need to set a delete policy or grace period or anything unless you really need these (and understand what they do). |
returning a stack object is consistent with stack=api.updateStack( so it would be good to leave it as such |
I wish I got to pick what the kube API server handed us back, we just have to go with what we get (which happens to be what you want, a Stack). I'm closing this as fixed in release 0.6.1. |
OK - so there may be more going on here. See this issue in the kube java client: I'm not sure I followed all of the conversation here, but, what may be happening is:
I have been writing unit tests for the operator bindings, and the kubernetes cluster where I'm testing does not have any part of Kabanero installed, just the CRDs. So, there are no finalizers. When I call The discussion in the java client issue seem to say that OpenAPI needs to support being able to return one or the other type. Java obviously allows only a single return type. The suggested workarounds included catching the exception, retry the delete, and see if the object is still there. That's hard to encapsulate in a client wrapper that shouldn't block. I suspect that where we'll end up is that we'll have to invent some return object type, that wraps both a |
api.deleteStack does not seem to work
trying to delete a stack that only has one version and this call fails and does not return any response object to debug what went wrong:
`
V1DeleteOptions deleteOptions = new V1DeleteOptions();
deleteOptions.setGracePeriodSeconds((long)3);
deleteOptions.setOrphanDependents(true);
deleteOptions.setKind("stacks");
deleteOptions.setApiVersion(apiVersion);
v1status=api.deleteStack(namespace, kabStack.getSpec().getName(), deleteOptions, 0, true, "");
The text was updated successfully, but these errors were encountered: