diff --git a/src/common/base-store.ts b/src/common/base-store.ts index 722698fa67..0cc087eb9f 100644 --- a/src/common/base-store.ts +++ b/src/common/base-store.ts @@ -135,8 +135,4 @@ export class BaseStore extends Singleton { recurseEverything: true, }) } - - * [Symbol.iterator]() { - yield* Object.entries(this.toJSON()); - } } diff --git a/src/common/kube-helpers.ts b/src/common/kube-helpers.ts index 3709f0ac94..9359ef4490 100644 --- a/src/common/kube-helpers.ts +++ b/src/common/kube-helpers.ts @@ -1,11 +1,10 @@ import { app, remote } from "electron"; import { KubeConfig, V1Node, V1Pod } from "@kubernetes/client-node" -import { ensureDirSync, readFile, writeFileSync } from "fs-extra"; +import fse, { ensureDirSync, readFile, writeFileSync } from "fs-extra"; import path from "path" import os from "os" import yaml from "js-yaml" import logger from "../main/logger"; -import fse from "fs-extra" function resolveTilde(filePath: string) { if (filePath[0] === "~" && (filePath[1] === "/" || filePath.length === 1)) { @@ -135,8 +134,6 @@ export function podHasIssues(pod: V1Pod) { ) } -// Logic adapted from dashboard -// see: https://github.com/kontena/kontena-k8s-dashboard/blob/7d8f9cb678cc817a22dd1886c5e79415b212b9bf/client/api/endpoints/nodes.api.ts#L147 export function getNodeWarningConditions(node: V1Node) { return node.status.conditions.filter(c => c.status.toLowerCase() === "true" && c.type !== "Ready" && c.type !== "HostUpgrades" diff --git a/src/common/tracker.ts b/src/common/tracker.ts index c904d2c806..bc9a8e191b 100644 --- a/src/common/tracker.ts +++ b/src/common/tracker.ts @@ -3,6 +3,7 @@ import ua from "universal-analytics" import { machineIdSync } from "node-machine-id" import Singleton from "./utils/singleton"; import { userStore } from "./user-store" +import logger from "../main/logger"; export class Tracker extends Singleton { static readonly GA_ID = "UA-159377374-1" @@ -40,7 +41,7 @@ export class Tracker extends Singleton { ...otherParams, }).send() } catch (err) { - console.error(`Failed to track "${eventCategory}:${eventAction}"`, err) + logger.error(`Failed to track "${eventCategory}:${eventAction}"`, err) } } }