Remove the direct dependency on deprecated "request" library
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -96,7 +96,6 @@
|
||||
"node-forge": "^1.3.1",
|
||||
"pg": "^8.3.0",
|
||||
"raw-body": "^2.4.1",
|
||||
"request": "^2.88.2",
|
||||
"selfsigned": "^2.0.0",
|
||||
"stoppable": "^1.1.0",
|
||||
"tar": "^6.1.12",
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
Watch,
|
||||
} from '@kubernetes/client-node';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Request } from 'request';
|
||||
|
||||
/**
|
||||
* An existing Kubernetes volume that will be used as base for mounts.
|
||||
@@ -228,7 +227,7 @@ export class KubernetesContainerRunner implements ContainerRunner {
|
||||
taskId: string,
|
||||
callback: (pod: V1Pod) => void,
|
||||
errorCallback: (reason: any) => void,
|
||||
): Promise<Request> {
|
||||
): Promise<{ abort: () => void }> {
|
||||
const watch = new Watch(this.kubeConfig);
|
||||
const labelSelector = `task=${taskId}`;
|
||||
return watch.watch(
|
||||
@@ -251,8 +250,8 @@ export class KubernetesContainerRunner implements ContainerRunner {
|
||||
taskId: string,
|
||||
logStream: Writable,
|
||||
): { promise: Promise<void>; close: () => Promise<void> } {
|
||||
let log: Promise<Request>;
|
||||
let req: Promise<Request>;
|
||||
let log: Promise<{ abort: () => void }>;
|
||||
let req: Promise<{ abort: () => void }>;
|
||||
const watchPromise = new Promise<void>((_, reject) => {
|
||||
req = this.watchPod(
|
||||
taskId,
|
||||
@@ -299,7 +298,7 @@ export class KubernetesContainerRunner implements ContainerRunner {
|
||||
promise: Promise<void>;
|
||||
close: () => Promise<void>;
|
||||
} {
|
||||
let req: Promise<Request>;
|
||||
let req: Promise<{ abort: () => void }>;
|
||||
const promise = new Promise<void>(async (resolve, reject) => {
|
||||
req = this.watchPod(
|
||||
taskId,
|
||||
|
||||
Reference in New Issue
Block a user