Logging improvement
parent
23e042fcbe
commit
6dbb6e8ccb
|
|
@ -1539,7 +1539,7 @@ class Kubernetes {
|
|||
core.info('Job created');
|
||||
yield kubernetes_storage_1.default.watchUntilPVCNotPending(this.kubeClient, this.pvcName, this.namespace);
|
||||
core.info('PVC Bound');
|
||||
this.setPodNameAndContainerName(yield this.getPod());
|
||||
this.setPodNameAndContainerName(yield this.findPod());
|
||||
core.info('Watching pod until running');
|
||||
yield this.watchUntilPodRunning();
|
||||
core.info('Pod running, streaming logs');
|
||||
|
|
@ -1553,18 +1553,13 @@ class Kubernetes {
|
|||
}
|
||||
});
|
||||
}
|
||||
getPod() {
|
||||
findPod() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (this.podName === '') {
|
||||
const pod = (yield this.kubeClient.listNamespacedPod(this.namespace)).body.items.find((x) => { var _a, _b; return ((_b = (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b['job-name']) === this.jobName; });
|
||||
if (pod === undefined) {
|
||||
throw new Error("pod with job-name label doesn't exist");
|
||||
}
|
||||
return pod;
|
||||
}
|
||||
else {
|
||||
return (yield this.kubeClient.readNamespacedPod(this.podName, this.namespace)).body;
|
||||
const pod = (yield this.kubeClient.listNamespacedPod(this.namespace)).body.items.find((x) => { var _a, _b; return ((_b = (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b['job-name']) === this.jobName; });
|
||||
if (pod === undefined) {
|
||||
throw new Error("pod with job-name label doesn't exist");
|
||||
}
|
||||
return pod;
|
||||
});
|
||||
}
|
||||
runCloneJob() {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -320,7 +320,7 @@ class Kubernetes implements RemoteBuilderProviderInterface {
|
|||
core.info('Job created');
|
||||
await KubernetesStorage.watchUntilPVCNotPending(this.kubeClient, this.pvcName, this.namespace);
|
||||
core.info('PVC Bound');
|
||||
this.setPodNameAndContainerName(await this.getPod());
|
||||
this.setPodNameAndContainerName(await this.findPod());
|
||||
core.info('Watching pod until running');
|
||||
await this.watchUntilPodRunning();
|
||||
core.info('Pod running, streaming logs');
|
||||
|
|
@ -333,18 +333,14 @@ class Kubernetes implements RemoteBuilderProviderInterface {
|
|||
}
|
||||
}
|
||||
|
||||
async getPod() {
|
||||
if (this.podName === '') {
|
||||
const pod = (await this.kubeClient.listNamespacedPod(this.namespace)).body.items.find(
|
||||
(x) => x.metadata?.labels?.['job-name'] === this.jobName,
|
||||
);
|
||||
if (pod === undefined) {
|
||||
throw new Error("pod with job-name label doesn't exist");
|
||||
}
|
||||
return pod;
|
||||
} else {
|
||||
return (await this.kubeClient.readNamespacedPod(this.podName, this.namespace)).body;
|
||||
async findPod() {
|
||||
const pod = (await this.kubeClient.listNamespacedPod(this.namespace)).body.items.find(
|
||||
(x) => x.metadata?.labels?.['job-name'] === this.jobName,
|
||||
);
|
||||
if (pod === undefined) {
|
||||
throw new Error("pod with job-name label doesn't exist");
|
||||
}
|
||||
return pod;
|
||||
}
|
||||
|
||||
async runCloneJob() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue