Improve k8s logging accuracy
parent
0412b98708
commit
aa18edc853
|
@ -3310,6 +3310,8 @@ class Kubernetes {
|
||||||
try {
|
try {
|
||||||
const existsAlready = yield this.doesJobExist(this.jobName);
|
const existsAlready = yield this.doesJobExist(this.jobName);
|
||||||
const existsFailedAlready = yield this.doesFailedJobExist();
|
const existsFailedAlready = yield this.doesFailedJobExist();
|
||||||
|
cloud_runner_logger_1.default.log(JSON.stringify(yield this.kubeClient.readNamespacedPodStatus(this.podName, this.namespace), undefined, 4));
|
||||||
|
cloud_runner_logger_1.default.log(JSON.stringify(yield this.kubeClient.readNamespacedPod(this.podName, this.namespace), undefined, 4));
|
||||||
if (!existsAlready || existsFailedAlready) {
|
if (!existsAlready || existsFailedAlready) {
|
||||||
cloud_runner_logger_1.default.log('Job does not exist');
|
cloud_runner_logger_1.default.log('Job does not exist');
|
||||||
yield this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
yield this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -135,6 +135,12 @@ class Kubernetes implements ProviderInterface {
|
||||||
try {
|
try {
|
||||||
const existsAlready = await this.doesJobExist(this.jobName);
|
const existsAlready = await this.doesJobExist(this.jobName);
|
||||||
const existsFailedAlready = await this.doesFailedJobExist();
|
const existsFailedAlready = await this.doesFailedJobExist();
|
||||||
|
CloudRunnerLogger.log(
|
||||||
|
JSON.stringify(await this.kubeClient.readNamespacedPodStatus(this.podName, this.namespace), undefined, 4),
|
||||||
|
);
|
||||||
|
CloudRunnerLogger.log(
|
||||||
|
JSON.stringify(await this.kubeClient.readNamespacedPod(this.podName, this.namespace), undefined, 4),
|
||||||
|
);
|
||||||
if (!existsAlready || existsFailedAlready) {
|
if (!existsAlready || existsFailedAlready) {
|
||||||
CloudRunnerLogger.log('Job does not exist');
|
CloudRunnerLogger.log('Job does not exist');
|
||||||
await this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
await this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
||||||
|
|
Loading…
Reference in New Issue