Add Cloud Runner Pipeline to Main (#472)

* fix: k8s error handling

(cherry picked from commit f633a3efb42432a6d2492712aead865a950c8dca)

* include main in main cloud-runner pipeline

(cherry picked from commit a40fbe941bba1ba4593c83c754b37363a969bfe5)
This commit is contained in:
Frostebite
2022-11-08 09:37:16 +00:00
committed by GitHub
parent 4cca069ebb
commit f300dd27bb
6 changed files with 26 additions and 8 deletions

View File

@@ -155,8 +155,14 @@ class Kubernetes implements ProviderInterface {
CloudRunnerLogger.log('Pod still running, recovering stream...');
}
} catch (error: any) {
const reason = error.response?.body?.reason || error.reason || ``;
const errorMessage = error.message || ``;
let errorParsed;
try {
errorParsed = JSON.parse(error);
} catch {
errorParsed = error;
}
const reason = errorParsed.reason || errorParsed.response?.body?.reason || ``;
const errorMessage = errorParsed.message || ``;
const continueStreaming = reason === `NotFound` || errorMessage.includes(`dial timeout, backstop`);
if (continueStreaming) {