nicknezis commented on a change in pull request #3426: WIP: Updated to support 
Kubernetes 1.16
URL: https://github.com/apache/incubator-heron/pull/3426#discussion_r361897294
 
 

 ##########
 File path: 
heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/AppsV1Controller.java
 ##########
 @@ -97,20 +95,13 @@ boolean submit(PackingPlan packingPlan) {
     for (PackingPlan.ContainerPlan containerPlan : 
packingPlan.getContainers()) {
       numberOfInstances = Math.max(numberOfInstances, 
containerPlan.getInstances().size());
     }
-    final V1beta1StatefulSet statefulSet = 
createStatefulSet(containerResource, numberOfInstances);
+    final V1StatefulSet statefulSet = createStatefulSet(containerResource, 
numberOfInstances);
 
     try {
-      final Response response =
-          client.createNamespacedStatefulSetCall(getNamespace(), statefulSet, 
null,
-              null, null).execute();
-      if (!response.isSuccessful()) {
-        LOG.log(Level.SEVERE, "Error creating topology message: " + 
response.message());
-        KubernetesUtils.logResponseBodyIfPresent(LOG, response);
-        // construct a message based on the k8s API server response
-        throw new TopologySubmissionException(
-            KubernetesUtils.errorMessageFromResponse(response));
-      }
-    } catch (IOException | ApiException e) {
+      final V1StatefulSet response =
+          client.createNamespacedStatefulSet(getNamespace(), statefulSet, null,
 
 Review comment:
   I believe the `ApiException` will have the status code because the 
`ApiClient` class checks the status code and throws the exception if there is 
an error. Is there any better logging you would suggest in the catch block when 
we deal with the `ApiException`?
   
   Here is a link to the 
[`ApiClient.handleResponse()`](https://github.com/kubernetes-client/java/blob/d94b271a7dc9636d1b5d930b047b94273b58aa83/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiClient.java#L954)
 logic.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to