Skip to content

Commit d6f4f7a

Browse files
authored
Merge pull request #48 from project-codeflare/fix-typescript-errors
typescript errors fix
2 parents 524543f + 9aa181b commit d6f4f7a

File tree

6 files changed

+10
-14
lines changed

6 files changed

+10
-14
lines changed

backend/src/routes/api/appwrappers/appwrapper-utils.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const { spawn } = require('child_process');
2-
const http = require('http');
32

43
class AllAppwrappers {
54
async get() {
@@ -29,7 +28,7 @@ class AllAppwrappers {
2928
//Identify message in last status condition, if state is other than 'Running'
3029
const conditionsArr: any[] = jsonData.status.conditions;
3130
const lastCondition = conditionsArr[conditionsArr.length - 1];
32-
let message: string = '';
31+
let message = '';
3332

3433
message = message + lastCondition.type;
3534
message = message + '. Reason: ' + lastCondition.reason;
@@ -40,7 +39,7 @@ class AllAppwrappers {
4039
jsonData.status.constructedMessage = message;
4140

4241
// create formatted age
43-
let timestr: string = '';
42+
let timestr = '';
4443
if (jsonData.metadata.creationTimestamp) {
4544
const dtCreation = new Date(jsonData.metadata.creationTimestamp);
4645
const delta = dtNow.getTime() - dtCreation.getTime();
@@ -67,9 +66,9 @@ class AllAppwrappers {
6766
jsonData.metadata.calculatedTimeSpent = timestr;
6867

6968
// Identify status and add to counts
70-
let numRequeuings: number = 0;
69+
let numRequeuings = 0;
7170
const state: string = jsonData.status.state.trim();
72-
let rephrasedState: string = '';
71+
let rephrasedState = '';
7372
if (state === '') {
7473
rephrasedState = 'Submitted';
7574
statusCounts.Other = statusCounts.Other + 1;
@@ -170,7 +169,7 @@ class AllAppwrappers {
170169

171170
pullJobs(): Promise<string> {
172171
return new Promise((resolve, reject) => {
173-
let jsonString: string = '';
172+
let jsonString = '';
174173
const child = spawn('sh', ['./src/routes/api/appwrappers/appwrapper_puller.sh'], {
175174
stdio: 'pipe',
176175
buffer: true,

backend/src/routes/api/appwrappers/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { secureRoute } from '../../../utils/route-security';
2-
import { KubeFastifyInstance, OauthFastifyRequest } from '../../../types';
3-
import { FastifyRequest, FastifyReply } from 'fastify';
2+
import { KubeFastifyInstance } from '../../../types';
43
import { AllAppwrappers } from './appwrapper-utils';
54

65
module.exports = module.exports = async (fastify: KubeFastifyInstance) => {

backend/src/routes/api/dev-impersonate/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { KubeFastifyInstance } from '../../../types';
66
import {
77
DEV_IMPERSONATE_PASSWORD,
88
DEV_IMPERSONATE_USER,
9-
DEV_IMPERSONATE_TOKEN, // Temporary workaround: get impersonate to work through a token, because of hostname resolve the problem and IBM not using OAuth proxy
9+
DEV_IMPERSONATE_TOKEN, // Temporary workaround: get impersonate to work through a token, because of hostname resolve the problem and IBM not using OAuth proxy
1010
} from '../../../utils/constants';
1111
import { createCustomError } from '../../../utils/requestUtils';
1212
import { devRoute } from '../../../utils/route-security';

backend/src/routes/api/mcad-prometheus/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { secureRoute } from '../../../utils/route-security';
22
import { KubeFastifyInstance, OauthFastifyRequest } from '../../../types';
3-
import { FastifyRequest, FastifyReply } from 'fastify';
43
import { metricsData } from './metricsData';
54

65
module.exports = module.exports = async (fastify: KubeFastifyInstance) => {

backend/src/routes/api/mcad-prometheus/metricsData.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const fetchPrometheusData = async (host: string, query: string, axiosInstance: A
99
});
1010

1111
const url = `https://${host}/api/v1/query?${params.toString()}`;
12-
console.log("FETCHING RPOMETJFDKS URL: ", url)
13-
return axios//Instance
12+
console.log('FETCHING RPOMETJFDKS URL: ', url)
13+
return axios //Instance
1414
.post(url)
1515
.then((res) => {
1616
return res.data.data.result;
@@ -66,7 +66,7 @@ const getMetricRange = async (
6666
step,
6767
axiosInstance,
6868
);
69-
console.log("fetched range data...: ", fetchedData)
69+
console.log('fetched range data...: ', fetchedData)
7070
return fetchedData;
7171
};
7272

backend/src/routes/api/metrics-data/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { secureRoute } from '../../../utils/route-security';
22
import { KubeFastifyInstance, OauthFastifyRequest } from '../../../types';
3-
import { FastifyRequest, FastifyReply } from 'fastify';
43
import { metricsData } from './metricsData';
54

65
module.exports = module.exports = async (fastify: KubeFastifyInstance) => {

0 commit comments

Comments
 (0)