Skip to content

Commit

Permalink
fix task monitor namespace override
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktrn committed May 9, 2024
1 parent f41ae3d commit 4c9dbc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/kubernetes-provider/src/taskMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ type TaskMonitorOptions = {

export class TaskMonitor {
#enabled = false;

#logger = new SimpleLogger("[TaskMonitor]");
#taskInformer: ReturnType<typeof k8s.makeInformer<k8s.V1Pod>>;
#processedPods = new Map<string, number>();
#queue = new PQueue({ concurrency: 10 });

#k8sClient: {
core: k8s.CoreV1Api;
kubeConfig: k8s.KubeConfig;
Expand All @@ -44,6 +46,10 @@ export class TaskMonitor {
private labelSelector = "app in (task-index, task-run)";

constructor(private opts: TaskMonitorOptions) {
if (opts.namespace) {
this.namespace = opts.namespace;
}

this.#k8sClient = this.#createK8sClient();

this.#taskInformer = this.#createTaskInformer();
Expand Down

0 comments on commit 4c9dbc4

Please sign in to comment.