fix: KubeStatus message/status/info full explanation

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2023-03-22 14:24:12 +04:00
1 parent b5187ba75f
commit 1272039e52
2 files changed
+4 -4

No files matched your search

@@ -58,9 +58,9 @@ export class PodApi extends KubeApi<Pod> {
const status = new KubeStatus(response); const status = new KubeStatus(response);
if (status.code >= 200 && status.code < 300) { if (status.code >= 200 && status.code < 300) {
return status.getMessage(); return status.getExplanation();
} else { } else {
throw status.getMessage(); throw status.getExplanation();
} }
} }
@@ -297,10 +297,10 @@ export class KubeStatus {
this.status = data.status || ""; this.status = data.status || "";
} }
getMessage() { getExplanation(): string {
const { code, message, reason, status } = this; const { code, message, reason, status } = this;
return `${code}: ${message ?? reason ?? status}`; return `${code}: ${message || reason || status}`;
} }
} }