예제 #1
0
 @Override
 public void deletePod(String podId) throws KubernetesClientException {
   try {
     kubernetesClient.deletePod(podId);
   } catch (Exception e) {
     String message = String.format("Could not delete kubernetes pod: [pod-id] %s", podId);
     log.error(message, e);
     throw new KubernetesClientException(message, e);
   }
 }
예제 #2
0
파일: Util.java 프로젝트: pires/fabric8
 public static void deletePods(KubernetesClient client, Logger logger, Filter<Pod> filter)
     throws MultiException {
   List<Throwable> errors = new ArrayList<>();
   for (Pod pod : client.getPods().getItems()) {
     if (filter.matches(pod)) {
       try {
         logger.info("Deleting pod:" + getId(pod));
         client.deletePod(getId(pod));
       } catch (Exception e) {
         errors.add(e);
       }
     }
   }
   if (!errors.isEmpty()) {
     throw new MultiException("Error while deleting pods", errors);
   }
 }