Skip to content

Commit

Permalink
Avoid pod garbage collection thread getting killed because of a commo…
Browse files Browse the repository at this point in the history
…n unhandled exception (#1579)
  • Loading branch information
Vlatombe authored Jun 27, 2024
1 parent fe48922 commit fa95177
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import hudson.model.TaskListener;
import hudson.util.FormValidation;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.client.KubernetesClientException;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
Expand Down Expand Up @@ -195,6 +196,8 @@ private static void garbageCollect() {
client.resource(pod).delete();
});
}
} catch (KubernetesClientException e) {
LOGGER.log(Level.WARNING, "Unexpected error while calling Kubernetes API", e);
} catch (KubernetesAuthException e) {
LOGGER.log(Level.WARNING, "Error authenticating to Kubernetes", e);
} catch (IOException e) {
Expand Down

0 comments on commit fa95177

Please sign in to comment.