disable k8s http error retry

pull/437/head
Frostebite 2022-11-01 22:39:14 +00:00
parent 0d4dcfdd33
commit bdfb2f0d90
3 changed files with 47 additions and 13 deletions

31
dist/index.js vendored
View File

@ -2979,11 +2979,28 @@ class Kubernetes {
}
listResources() {
return __awaiter(this, void 0, void 0, function* () {
yield this.kubeClient.listNamespacedPod(this.namespace);
yield this.kubeClient.listNamespacedServiceAccount(this.namespace);
yield this.kubeClient.listNamespacedSecret(this.namespace);
yield this.kubeClientBatch.listNamespacedJob(this.namespace);
return [];
const pods = yield this.kubeClient.listNamespacedPod(this.namespace);
const serviceAccounts = yield this.kubeClient.listNamespacedServiceAccount(this.namespace);
const secrets = yield this.kubeClient.listNamespacedSecret(this.namespace);
const jobs = yield this.kubeClientBatch.listNamespacedJob(this.namespace);
return [
...pods.body.items.map((x) => {
var _a;
return { Name: ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || `` };
}),
...serviceAccounts.body.items.map((x) => {
var _a;
return { Name: ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || `` };
}),
...secrets.body.items.map((x) => {
var _a;
return { Name: ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || `` };
}),
...jobs.body.items.map((x) => {
var _a;
return { Name: ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || `` };
}),
];
});
}
inspectResources() {
@ -3057,7 +3074,9 @@ class Kubernetes {
}
catch (error) {
cloud_runner_logger_1.default.log('error running k8s workflow');
if (error.message.includes(`HTTP`)) {
cloud_runner_logger_1.default.log(error.message);
if (error.message.includes(`HTTP disabled for now`)) {
cloud_runner_logger_1.default.log('retrying watch because error includes HTTP ignore code');
continue;
}
else {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -41,12 +41,25 @@ class Kubernetes implements ProviderInterface {
}
async listResources(): Promise<ProviderResource[]> {
await this.kubeClient.listNamespacedPod(this.namespace);
await this.kubeClient.listNamespacedServiceAccount(this.namespace);
await this.kubeClient.listNamespacedSecret(this.namespace);
await this.kubeClientBatch.listNamespacedJob(this.namespace);
const pods = await this.kubeClient.listNamespacedPod(this.namespace);
const serviceAccounts = await this.kubeClient.listNamespacedServiceAccount(this.namespace);
const secrets = await this.kubeClient.listNamespacedSecret(this.namespace);
const jobs = await this.kubeClientBatch.listNamespacedJob(this.namespace);
return [];
return [
...pods.body.items.map((x) => {
return { Name: x.metadata?.name || `` };
}),
...serviceAccounts.body.items.map((x) => {
return { Name: x.metadata?.name || `` };
}),
...secrets.body.items.map((x) => {
return { Name: x.metadata?.name || `` };
}),
...jobs.body.items.map((x) => {
return { Name: x.metadata?.name || `` };
}),
];
}
inspectResources(): Promise<ProviderResource> {
throw new Error('Method not implemented.');
@ -141,7 +154,9 @@ class Kubernetes implements ProviderInterface {
break;
} catch (error: any) {
CloudRunnerLogger.log('error running k8s workflow');
if (error.message.includes(`HTTP`)) {
CloudRunnerLogger.log(error.message);
if (error.message.includes(`HTTP disabled for now`)) {
CloudRunnerLogger.log('retrying watch because error includes HTTP ignore code');
continue;
} else {
throw error;