disable k8s http error retry
parent
0d4dcfdd33
commit
bdfb2f0d90
|
|
@ -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 {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue