mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint no-trailing-spaces, quote-props, space-infix-ops and arrow-parens rules
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
parent
6630419457
commit
f65861bfee
92
.eslintrc.js
92
.eslintrc.js
@ -31,20 +31,20 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
"indent": ["error", 2, {
|
"indent": ["error", 2, {
|
||||||
"SwitchCase": 1,
|
SwitchCase: 1,
|
||||||
}],
|
}],
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
"unused-imports/no-unused-vars": [
|
"unused-imports/no-unused-vars": [
|
||||||
"warn", {
|
"warn", {
|
||||||
"vars": "all",
|
vars: "all",
|
||||||
"args": "after-used",
|
args: "after-used",
|
||||||
"ignoreRestSiblings": true,
|
ignoreRestSiblings: true,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quotes": ["error", "double", {
|
"quotes": ["error", "double", {
|
||||||
"avoidEscape": true,
|
avoidEscape: true,
|
||||||
"allowTemplateLiterals": true,
|
allowTemplateLiterals: true,
|
||||||
}],
|
}],
|
||||||
"semi": ["error", "always"],
|
"semi": ["error", "always"],
|
||||||
"object-shorthand": "error",
|
"object-shorthand": "error",
|
||||||
@ -52,13 +52,17 @@ module.exports = {
|
|||||||
"template-curly-spacing": "error",
|
"template-curly-spacing": "error",
|
||||||
"padding-line-between-statements": [
|
"padding-line-between-statements": [
|
||||||
"error",
|
"error",
|
||||||
{ "blankLine": "always", "prev": "*", "next": "return" },
|
{ blankLine: "always", prev: "*", next: "return" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "block-like" },
|
{ blankLine: "always", prev: "*", next: "block-like" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "function" },
|
{ blankLine: "always", prev: "*", next: "function" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "class" },
|
{ blankLine: "always", prev: "*", next: "class" },
|
||||||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
|
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
|
||||||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
|
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]},
|
||||||
]
|
],
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"quote-props": ["error", "consistent-as-needed"],
|
||||||
|
"space-infix-ops": ["error", { int32Hint: false }],
|
||||||
|
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -87,17 +91,17 @@ module.exports = {
|
|||||||
"unused-imports/no-unused-imports-ts": "error",
|
"unused-imports/no-unused-imports-ts": "error",
|
||||||
"unused-imports/no-unused-vars-ts": [
|
"unused-imports/no-unused-vars-ts": [
|
||||||
"warn", {
|
"warn", {
|
||||||
"vars": "all",
|
vars: "all",
|
||||||
"args": "after-used",
|
args: "after-used",
|
||||||
"ignoreRestSiblings": true,
|
ignoreRestSiblings: true,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"indent": ["error", 2, {
|
"indent": ["error", 2, {
|
||||||
"SwitchCase": 1,
|
SwitchCase: 1,
|
||||||
}],
|
}],
|
||||||
"quotes": ["error", "double", {
|
"quotes": ["error", "double", {
|
||||||
"avoidEscape": true,
|
avoidEscape: true,
|
||||||
"allowTemplateLiterals": true,
|
allowTemplateLiterals: true,
|
||||||
}],
|
}],
|
||||||
"semi": "off",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": ["error"],
|
"@typescript-eslint/semi": ["error"],
|
||||||
@ -106,13 +110,18 @@ module.exports = {
|
|||||||
"template-curly-spacing": "error",
|
"template-curly-spacing": "error",
|
||||||
"padding-line-between-statements": [
|
"padding-line-between-statements": [
|
||||||
"error",
|
"error",
|
||||||
{ "blankLine": "always", "prev": "*", "next": "return" },
|
{ blankLine: "always", prev: "*", next: "return" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "block-like" },
|
{ blankLine: "always", prev: "*", next: "block-like" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "function" },
|
{ blankLine: "always", prev: "*", next: "function" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "class" },
|
{ blankLine: "always", prev: "*", next: "class" },
|
||||||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
|
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
|
||||||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
|
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]},
|
||||||
]
|
],
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"quote-props": ["error", "consistent-as-needed"],
|
||||||
|
"space-infix-ops": "off",
|
||||||
|
"@typescript-eslint/space-infix-ops": ["error", { int32Hint: false }],
|
||||||
|
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -148,17 +157,17 @@ module.exports = {
|
|||||||
"unused-imports/no-unused-imports-ts": "error",
|
"unused-imports/no-unused-imports-ts": "error",
|
||||||
"unused-imports/no-unused-vars-ts": [
|
"unused-imports/no-unused-vars-ts": [
|
||||||
"warn", {
|
"warn", {
|
||||||
"vars": "all",
|
vars: "all",
|
||||||
"args": "after-used",
|
args: "after-used",
|
||||||
"ignoreRestSiblings": true,
|
ignoreRestSiblings: true,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"indent": ["error", 2, {
|
"indent": ["error", 2, {
|
||||||
"SwitchCase": 1,
|
SwitchCase: 1,
|
||||||
}],
|
}],
|
||||||
"quotes": ["error", "double", {
|
"quotes": ["error", "double", {
|
||||||
"avoidEscape": true,
|
avoidEscape: true,
|
||||||
"allowTemplateLiterals": true,
|
allowTemplateLiterals: true,
|
||||||
}],
|
}],
|
||||||
"semi": "off",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": ["error"],
|
"@typescript-eslint/semi": ["error"],
|
||||||
@ -167,13 +176,18 @@ module.exports = {
|
|||||||
"template-curly-spacing": "error",
|
"template-curly-spacing": "error",
|
||||||
"padding-line-between-statements": [
|
"padding-line-between-statements": [
|
||||||
"error",
|
"error",
|
||||||
{ "blankLine": "always", "prev": "*", "next": "return" },
|
{ blankLine: "always", prev: "*", next: "return" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "block-like" },
|
{ blankLine: "always", prev: "*", next: "block-like" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "function" },
|
{ blankLine: "always", prev: "*", next: "function" },
|
||||||
{ "blankLine": "always", "prev": "*", "next": "class" },
|
{ blankLine: "always", prev: "*", next: "class" },
|
||||||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
|
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
|
||||||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
|
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]},
|
||||||
]
|
],
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"quote-props": ["error", "consistent-as-needed"],
|
||||||
|
"space-infix-ops": "off",
|
||||||
|
"@typescript-eslint/space-infix-ops": ["error", { int32Hint: false }],
|
||||||
|
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export class PodLogsMenu extends React.Component<PodLogsMenuProps> {
|
|||||||
<Component.Icon className="arrow" material="keyboard_arrow_right"/>
|
<Component.Icon className="arrow" material="keyboard_arrow_right"/>
|
||||||
<Component.SubMenu>
|
<Component.SubMenu>
|
||||||
{
|
{
|
||||||
containers.map(container => {
|
containers.map((container) => {
|
||||||
const { name } = container;
|
const { name } = container;
|
||||||
const status = statuses.find(status => status.name === name);
|
const status = statuses.find(status => status.name === name);
|
||||||
const brick = status ? (
|
const brick = status ? (
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export class PodShellMenu extends React.Component<PodShellMenuProps> {
|
|||||||
<Component.Icon className="arrow" material="keyboard_arrow_right"/>
|
<Component.Icon className="arrow" material="keyboard_arrow_right"/>
|
||||||
<Component.SubMenu>
|
<Component.SubMenu>
|
||||||
{
|
{
|
||||||
containers.map(container => {
|
containers.map((container) => {
|
||||||
const { name } = container;
|
const { name } = container;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export class TelemetryPreferenceInput extends React.Component<{telemetry: Teleme
|
|||||||
<Component.Checkbox
|
<Component.Checkbox
|
||||||
label="Allow telemetry & usage tracking"
|
label="Allow telemetry & usage tracking"
|
||||||
value={telemetry.enabled}
|
value={telemetry.enabled}
|
||||||
onChange={v => { telemetry.enabled = v; }}
|
onChange={(v) => { telemetry.enabled = v; }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,12 +61,12 @@ export class Tracker extends Util.Singleton {
|
|||||||
this.disposers.push(reaction(() => App.getEnabledExtensions(), (currentExtensions) => {
|
this.disposers.push(reaction(() => App.getEnabledExtensions(), (currentExtensions) => {
|
||||||
const removedExtensions = previousExtensions.filter(x => !currentExtensions.includes(x));
|
const removedExtensions = previousExtensions.filter(x => !currentExtensions.includes(x));
|
||||||
|
|
||||||
removedExtensions.forEach(ext => {
|
removedExtensions.forEach((ext) => {
|
||||||
this.event("extension", "disable", { extension: ext });
|
this.event("extension", "disable", { extension: ext });
|
||||||
});
|
});
|
||||||
const newExtensions = currentExtensions.filter(x => !previousExtensions.includes(x));
|
const newExtensions = currentExtensions.filter(x => !previousExtensions.includes(x));
|
||||||
|
|
||||||
newExtensions.forEach(ext => {
|
newExtensions.forEach((ext) => {
|
||||||
this.event("extension", "enable", { extension: ext });
|
this.event("extension", "enable", { extension: ext });
|
||||||
});
|
});
|
||||||
previousExtensions = currentExtensions;
|
previousExtensions = currentExtensions;
|
||||||
@ -91,7 +91,7 @@ export class Tracker extends Util.Singleton {
|
|||||||
if (this.reportInterval) {
|
if (this.reportInterval) {
|
||||||
clearInterval(this.reportInterval);
|
clearInterval(this.reportInterval);
|
||||||
}
|
}
|
||||||
this.disposers.forEach(disposer => {
|
this.disposers.forEach((disposer) => {
|
||||||
disposer();
|
disposer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { Application } from "spectron";
|
import { Application } from "spectron";
|
||||||
|
|
||||||
const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
|
const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
|
||||||
"win32": "./dist/win-unpacked/Lens.exe",
|
win32: "./dist/win-unpacked/Lens.exe",
|
||||||
"linux": "./dist/linux-unpacked/kontena-lens",
|
linux: "./dist/linux-unpacked/kontena-lens",
|
||||||
"darwin": "./dist/mac/Lens.app/Contents/MacOS/Lens",
|
darwin: "./dist/mac/Lens.app/Contents/MacOS/Lens",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function itIf(condition: boolean) {
|
export function itIf(condition: boolean) {
|
||||||
|
|||||||
@ -320,8 +320,8 @@
|
|||||||
"@types/webpack-dev-server": "^3.11.1",
|
"@types/webpack-dev-server": "^3.11.1",
|
||||||
"@types/webpack-env": "^1.15.2",
|
"@types/webpack-env": "^1.15.2",
|
||||||
"@types/webpack-node-externals": "^1.7.1",
|
"@types/webpack-node-externals": "^1.7.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.0.0",
|
"@typescript-eslint/eslint-plugin": "^4.9.0",
|
||||||
"@typescript-eslint/parser": "^4.0.0",
|
"@typescript-eslint/parser": "^4.9.0",
|
||||||
"ace-builds": "^1.4.11",
|
"ace-builds": "^1.4.11",
|
||||||
"ansi_up": "^4.0.4",
|
"ansi_up": "^4.0.4",
|
||||||
"babel-core": "^7.0.0-beta.3",
|
"babel-core": "^7.0.0-beta.3",
|
||||||
|
|||||||
@ -27,7 +27,7 @@ describe("empty config", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({})
|
"lens-cluster-store.json": JSON.stringify({})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -167,7 +167,7 @@ describe("config with existing clusters", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
@ -251,7 +251,7 @@ describe("pre 2.0 config with an existing cluster", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
@ -284,7 +284,7 @@ describe("pre 2.6.0 config with a cluster that has arrays in auth config", () =>
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
@ -322,7 +322,7 @@ describe("pre 2.6.0 config with a cluster icon", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
@ -364,7 +364,7 @@ describe("for a pre 2.7.0-beta.0 config without a workspace", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
@ -402,7 +402,7 @@ describe("pre 3.6.0-beta.1 config with an existing cluster", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
const mockOpts = {
|
const mockOpts = {
|
||||||
"tmp": {
|
tmp: {
|
||||||
"lens-cluster-store.json": JSON.stringify({
|
"lens-cluster-store.json": JSON.stringify({
|
||||||
__internal__: {
|
__internal__: {
|
||||||
migrations: {
|
migrations: {
|
||||||
|
|||||||
@ -81,7 +81,7 @@ describe("user store tests", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
UserStore.resetInstance();
|
UserStore.resetInstance();
|
||||||
mockFs({
|
mockFs({
|
||||||
"tmp": {
|
tmp: {
|
||||||
"config.json": JSON.stringify({
|
"config.json": JSON.stringify({
|
||||||
user: { username: "foobar" },
|
user: { username: "foobar" },
|
||||||
preferences: { colorTheme: "light" },
|
preferences: { colorTheme: "light" },
|
||||||
|
|||||||
@ -196,7 +196,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get enabledClustersList(): Cluster[] {
|
@computed get enabledClustersList(): Cluster[] {
|
||||||
return this.clustersList.filter((c) => c.enabled);
|
return this.clustersList.filter(c => c.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get active(): Cluster | null {
|
@computed get active(): Cluster | null {
|
||||||
@ -204,7 +204,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get connectedClustersList(): Cluster[] {
|
@computed get connectedClustersList(): Cluster[] {
|
||||||
return this.clustersList.filter((c) => !c.disconnected);
|
return this.clustersList.filter(c => !c.disconnected);
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive(id: ClusterId) {
|
isActive(id: ClusterId) {
|
||||||
@ -254,7 +254,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
addClusters(...models: ClusterModel[]): Cluster[] {
|
addClusters(...models: ClusterModel[]): Cluster[] {
|
||||||
const clusters: Cluster[] = [];
|
const clusters: Cluster[] = [];
|
||||||
|
|
||||||
models.forEach(model => {
|
models.forEach((model) => {
|
||||||
clusters.push(this.addCluster(model));
|
clusters.push(this.addCluster(model));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
removeByWorkspaceId(workspaceId: string) {
|
removeByWorkspaceId(workspaceId: string) {
|
||||||
this.getByWorkspaceId(workspaceId).forEach(cluster => {
|
this.getByWorkspaceId(workspaceId).forEach((cluster) => {
|
||||||
this.removeById(cluster.id);
|
this.removeById(cluster.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update removed clusters
|
// update removed clusters
|
||||||
currentClusters.forEach(cluster => {
|
currentClusters.forEach((cluster) => {
|
||||||
if (!newClusters.has(cluster.id)) {
|
if (!newClusters.has(cluster.id)) {
|
||||||
removedClusters.set(cluster.id, cluster);
|
removedClusters.set(cluster.id, cluster);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export async function requestMain(channel: string, ...args: any[]) {
|
|||||||
async function getSubFrames(): Promise<number[]> {
|
async function getSubFrames(): Promise<number[]> {
|
||||||
const subFrames: number[] = [];
|
const subFrames: number[] = [];
|
||||||
|
|
||||||
clusterFrameMap.forEach(frameId => {
|
clusterFrameMap.forEach((frameId) => {
|
||||||
subFrames.push(frameId);
|
subFrames.push(frameId);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ export function broadcastMessage(channel: string, ...args: any[]) {
|
|||||||
|
|
||||||
if (!views) return;
|
if (!views) return;
|
||||||
|
|
||||||
views.forEach(webContent => {
|
views.forEach((webContent) => {
|
||||||
const type = webContent.getType();
|
const type = webContent.getType();
|
||||||
|
|
||||||
logger.silly(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
|
logger.silly(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
|
||||||
@ -38,7 +38,7 @@ export function broadcastMessage(channel: string, ...args: any[]) {
|
|||||||
frames.map((frameId) => {
|
frames.map((frameId) => {
|
||||||
webContent.sendToFrame(frameId, channel, ...args);
|
webContent.sendToFrame(frameId, channel, ...args);
|
||||||
});
|
});
|
||||||
}).catch((e) => e);
|
}).catch(e => e);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ipcRenderer) {
|
if (ipcRenderer) {
|
||||||
|
|||||||
@ -66,7 +66,7 @@ export function splitConfig(kubeConfig: KubeConfig): KubeConfig[] {
|
|||||||
if (!kubeConfig.contexts) {
|
if (!kubeConfig.contexts) {
|
||||||
return configs;
|
return configs;
|
||||||
}
|
}
|
||||||
kubeConfig.contexts.forEach(ctx => {
|
kubeConfig.contexts.forEach((ctx) => {
|
||||||
const kc = new KubeConfig();
|
const kc = new KubeConfig();
|
||||||
|
|
||||||
kc.clusters = [kubeConfig.getCluster(ctx.cluster)].filter(n => n);
|
kc.clusters = [kubeConfig.getCluster(ctx.cluster)].filter(n => n);
|
||||||
@ -82,22 +82,22 @@ export function splitConfig(kubeConfig: KubeConfig): KubeConfig[] {
|
|||||||
|
|
||||||
export function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string {
|
export function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string {
|
||||||
const config = {
|
const config = {
|
||||||
apiVersion: "v1",
|
"apiVersion": "v1",
|
||||||
kind: "Config",
|
"kind": "Config",
|
||||||
preferences: {},
|
"preferences": {},
|
||||||
"current-context": kubeConfig.currentContext,
|
"current-context": kubeConfig.currentContext,
|
||||||
clusters: kubeConfig.clusters.map(cluster => {
|
"clusters": kubeConfig.clusters.map((cluster) => {
|
||||||
return {
|
return {
|
||||||
name: cluster.name,
|
name: cluster.name,
|
||||||
cluster: {
|
cluster: {
|
||||||
"certificate-authority-data": cluster.caData,
|
"certificate-authority-data": cluster.caData,
|
||||||
"certificate-authority": cluster.caFile,
|
"certificate-authority": cluster.caFile,
|
||||||
server: cluster.server,
|
"server": cluster.server,
|
||||||
"insecure-skip-tls-verify": cluster.skipTLSVerify
|
"insecure-skip-tls-verify": cluster.skipTLSVerify
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
contexts: kubeConfig.contexts.map(context => {
|
"contexts": kubeConfig.contexts.map((context) => {
|
||||||
return {
|
return {
|
||||||
name: context.name,
|
name: context.name,
|
||||||
context: {
|
context: {
|
||||||
@ -107,7 +107,7 @@ export function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
users: kubeConfig.users.map(user => {
|
"users": kubeConfig.users.map((user) => {
|
||||||
return {
|
return {
|
||||||
name: user.name,
|
name: user.name,
|
||||||
user: {
|
user: {
|
||||||
@ -116,10 +116,10 @@ export function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string {
|
|||||||
"client-key-data": user.keyData,
|
"client-key-data": user.keyData,
|
||||||
"client-key": user.keyFile,
|
"client-key": user.keyFile,
|
||||||
"auth-provider": user.authProvider,
|
"auth-provider": user.authProvider,
|
||||||
exec: user.exec,
|
"exec": user.exec,
|
||||||
token: user.token,
|
"token": user.token,
|
||||||
username: user.username,
|
"username": user.username,
|
||||||
password: user.password
|
"password": user.password
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@ -133,7 +133,7 @@ export function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string {
|
|||||||
|
|
||||||
export function podHasIssues(pod: V1Pod) {
|
export function podHasIssues(pod: V1Pod) {
|
||||||
// Logic adapted from dashboard
|
// Logic adapted from dashboard
|
||||||
const notReady = !!pod.status.conditions.find(condition => {
|
const notReady = !!pod.status.conditions.find((condition) => {
|
||||||
return condition.type == "Ready" && condition.status !== "True";
|
return condition.type == "Ready" && condition.status !== "True";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { PrometheusOperator } from "../main/prometheus/operator";
|
|||||||
import { PrometheusStacklight } from "../main/prometheus/stacklight";
|
import { PrometheusStacklight } from "../main/prometheus/stacklight";
|
||||||
import { PrometheusProviderRegistry } from "../main/prometheus/provider-registry";
|
import { PrometheusProviderRegistry } from "../main/prometheus/provider-registry";
|
||||||
|
|
||||||
[PrometheusLens, PrometheusHelm, PrometheusOperator, PrometheusStacklight].forEach(providerClass => {
|
[PrometheusLens, PrometheusHelm, PrometheusOperator, PrometheusStacklight].forEach((providerClass) => {
|
||||||
const provider = new providerClass();
|
const provider = new providerClass();
|
||||||
|
|
||||||
PrometheusProviderRegistry.registerProvider(provider.id, provider);
|
PrometheusProviderRegistry.registerProvider(provider.id, provider);
|
||||||
|
|||||||
@ -65,12 +65,12 @@ export class UserStore extends BaseStore<UserStoreModel> {
|
|||||||
|
|
||||||
if (app) {
|
if (app) {
|
||||||
// track telemetry availability
|
// track telemetry availability
|
||||||
reaction(() => this.preferences.allowTelemetry, allowed => {
|
reaction(() => this.preferences.allowTelemetry, (allowed) => {
|
||||||
appEventBus.emit({name: "telemetry", action: allowed ? "enabled" : "disabled"});
|
appEventBus.emit({name: "telemetry", action: allowed ? "enabled" : "disabled"});
|
||||||
});
|
});
|
||||||
|
|
||||||
// open at system start-up
|
// open at system start-up
|
||||||
reaction(() => this.preferences.openAtLogin, open => {
|
reaction(() => this.preferences.openAtLogin, (open) => {
|
||||||
app.setLoginItemSettings({ openAtLogin: open });
|
app.setLoginItemSettings({ openAtLogin: open });
|
||||||
}, {
|
}, {
|
||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ function bindClass<T extends Constructor>(constructor: T) {
|
|||||||
|| typeof descriptors[methodName].value !== "function";
|
|| typeof descriptors[methodName].value !== "function";
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.keys(descriptors).forEach(prop => {
|
Object.keys(descriptors).forEach((prop) => {
|
||||||
if (skipMethod(prop)) return;
|
if (skipMethod(prop)) return;
|
||||||
const boundDescriptor = bindMethod(proto, prop, descriptors[prop]);
|
const boundDescriptor = bindMethod(proto, prop, descriptors[prop]);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
export function debouncePromise<T, F extends any[]>(func: (...args: F) => T | Promise<T>, timeout = 0): (...args: F) => Promise<T> {
|
export function debouncePromise<T, F extends any[]>(func: (...args: F) => T | Promise<T>, timeout = 0): (...args: F) => Promise<T> {
|
||||||
let timer: NodeJS.Timeout;
|
let timer: NodeJS.Timeout;
|
||||||
|
|
||||||
return (...params: any[]) => new Promise(resolve => {
|
return (...params: any[]) => new Promise((resolve) => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = global.setTimeout(() => resolve(func.apply(this, params)), timeout);
|
timer = global.setTimeout(() => resolve(func.apply(this, params)), timeout);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export function downloadFile({ url, timeout, gzip = true }: DownloadFileOptions)
|
|||||||
req.on("data", (chunk: Buffer) => {
|
req.on("data", (chunk: Buffer) => {
|
||||||
fileChunks.push(chunk);
|
fileChunks.push(chunk);
|
||||||
});
|
});
|
||||||
req.once("error", err => {
|
req.once("error", (err) => {
|
||||||
reject({ url, err });
|
reject({ url, err });
|
||||||
});
|
});
|
||||||
req.once("complete", () => {
|
req.once("complete", () => {
|
||||||
|
|||||||
@ -17,10 +17,10 @@ export function readFileFromTar<R = Buffer>({ tarPath, filePath, parseJson }: Re
|
|||||||
file: tarPath,
|
file: tarPath,
|
||||||
filter: entryPath => path.normalize(entryPath) === filePath,
|
filter: entryPath => path.normalize(entryPath) === filePath,
|
||||||
onentry(entry: FileStat) {
|
onentry(entry: FileStat) {
|
||||||
entry.on("data", chunk => {
|
entry.on("data", (chunk) => {
|
||||||
fileChunks.push(chunk);
|
fileChunks.push(chunk);
|
||||||
});
|
});
|
||||||
entry.once("error", err => {
|
entry.once("error", (err) => {
|
||||||
reject(new Error(`reading file has failed ${entry.path}: ${err}`));
|
reject(new Error(`reading file has failed ${entry.path}: ${err}`));
|
||||||
});
|
});
|
||||||
entry.once("end", () => {
|
entry.once("end", () => {
|
||||||
|
|||||||
@ -183,7 +183,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get enabledWorkspacesList() {
|
@computed get enabledWorkspacesList() {
|
||||||
return this.workspacesList.filter((w) => w.enabled);
|
return this.workspacesList.filter(w => w.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
pushState() {
|
pushState() {
|
||||||
@ -274,7 +274,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
|||||||
|
|
||||||
if (workspaces.length) {
|
if (workspaces.length) {
|
||||||
this.workspaces.clear();
|
this.workspaces.clear();
|
||||||
workspaces.forEach(ws => {
|
workspaces.forEach((ws) => {
|
||||||
const workspace = new Workspace(ws);
|
const workspace = new Workspace(ws);
|
||||||
|
|
||||||
if (!workspace.isManaged) {
|
if (!workspace.isManaged) {
|
||||||
@ -288,7 +288,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
|||||||
toJSON(): WorkspaceStoreModel {
|
toJSON(): WorkspaceStoreModel {
|
||||||
return toJS({
|
return toJS({
|
||||||
currentWorkspace: this.currentWorkspaceId,
|
currentWorkspace: this.currentWorkspaceId,
|
||||||
workspaces: this.workspacesList.map((w) => w.toJSON()),
|
workspaces: this.workspacesList.map(w => w.toJSON()),
|
||||||
}, {
|
}, {
|
||||||
recurseEverything: true
|
recurseEverything: true
|
||||||
});
|
});
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export abstract class ClusterFeature {
|
|||||||
const resources: string[] = [];
|
const resources: string[] = [];
|
||||||
|
|
||||||
logger.info(`[FEATURE]: render templates from ${folderPath}`);
|
logger.info(`[FEATURE]: render templates from ${folderPath}`);
|
||||||
fs.readdirSync(folderPath).forEach(filename => {
|
fs.readdirSync(folderPath).forEach((filename) => {
|
||||||
const file = path.join(folderPath, filename);
|
const file = path.join(folderPath, filename);
|
||||||
const raw = fs.readFileSync(file);
|
const raw = fs.readFileSync(file);
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ export class ExtensionLoader {
|
|||||||
|
|
||||||
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
||||||
if (removedExtension.id === extension.id) {
|
if (removedExtension.id === extension.id) {
|
||||||
removeItems.forEach(remove => {
|
removeItems.forEach((remove) => {
|
||||||
remove();
|
remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ export class ExtensionLoader {
|
|||||||
|
|
||||||
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
||||||
if (removedExtension.id === extension.id) {
|
if (removedExtension.id === extension.id) {
|
||||||
removeItems.forEach(remove => {
|
removeItems.forEach((remove) => {
|
||||||
remove();
|
remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ export class ExtensionLoader {
|
|||||||
|
|
||||||
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
||||||
if (removedExtension.id === extension.id) {
|
if (removedExtension.id === extension.id) {
|
||||||
removeItems.forEach(remove => {
|
removeItems.forEach((remove) => {
|
||||||
remove();
|
remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ export class ExtensionLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected autoInitExtensions(register: (ext: LensExtension) => Promise<Function[]>) {
|
protected autoInitExtensions(register: (ext: LensExtension) => Promise<Function[]>) {
|
||||||
return reaction(() => this.toJSON(), installedExtensions => {
|
return reaction(() => this.toJSON(), (installedExtensions) => {
|
||||||
for (const [extId, extension] of installedExtensions) {
|
for (const [extId, extension] of installedExtensions) {
|
||||||
const alreadyInit = this.instances.has(extId);
|
const alreadyInit = this.instances.has(extId);
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export class ExtensionsStore extends BaseStore<LensExtensionsStoreModel> {
|
|||||||
await this.whenLoaded;
|
await this.whenLoaded;
|
||||||
|
|
||||||
// save state on change `extension.isEnabled`
|
// save state on change `extension.isEnabled`
|
||||||
reaction(() => this.getState(extensionLoader), extensionsState => {
|
reaction(() => this.getState(extensionLoader), (extensionsState) => {
|
||||||
this.state.merge(extensionsState);
|
this.state.merge(extensionsState);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class BaseRegistry<T> {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
remove(...items: T[]) {
|
remove(...items: T[]) {
|
||||||
items.forEach(item => {
|
items.forEach((item) => {
|
||||||
this.items.remove(item); // works because of {deep: false};
|
this.items.remove(item); // works because of {deep: false};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export interface PageMenuComponents {
|
|||||||
export class GlobalPageMenuRegistry extends BaseRegistry<PageMenuRegistration> {
|
export class GlobalPageMenuRegistry extends BaseRegistry<PageMenuRegistration> {
|
||||||
@action
|
@action
|
||||||
add(items: PageMenuRegistration[], ext: LensExtension) {
|
add(items: PageMenuRegistration[], ext: LensExtension) {
|
||||||
const normalizedItems = items.map(menuItem => {
|
const normalizedItems = items.map((menuItem) => {
|
||||||
menuItem.target = {
|
menuItem.target = {
|
||||||
extensionId: ext.name,
|
extensionId: ext.name,
|
||||||
...(menuItem.target || {}),
|
...(menuItem.target || {}),
|
||||||
@ -46,7 +46,7 @@ export class GlobalPageMenuRegistry extends BaseRegistry<PageMenuRegistration> {
|
|||||||
export class ClusterPageMenuRegistry extends BaseRegistry<ClusterPageMenuRegistration> {
|
export class ClusterPageMenuRegistry extends BaseRegistry<ClusterPageMenuRegistration> {
|
||||||
@action
|
@action
|
||||||
add(items: PageMenuRegistration[], ext: LensExtension) {
|
add(items: PageMenuRegistration[], ext: LensExtension) {
|
||||||
const normalizedItems = items.map(menuItem => {
|
const normalizedItems = items.map((menuItem) => {
|
||||||
menuItem.target = {
|
menuItem.target = {
|
||||||
extensionId: ext.name,
|
extensionId: ext.name,
|
||||||
...(menuItem.target || {}),
|
...(menuItem.target || {}),
|
||||||
@ -59,15 +59,15 @@ export class ClusterPageMenuRegistry extends BaseRegistry<ClusterPageMenuRegistr
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRootItems() {
|
getRootItems() {
|
||||||
return this.getItems().filter((item) => !item.parentId);
|
return this.getItems().filter(item => !item.parentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubItems(parent: ClusterPageMenuRegistration) {
|
getSubItems(parent: ClusterPageMenuRegistration) {
|
||||||
return this.getItems().filter((item) => item.parentId === parent.id && item.target.extensionId === parent.target.extensionId);
|
return this.getItems().filter(item => item.parentId === parent.id && item.target.extensionId === parent.target.extensionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getByPage(page: RegisteredPage) {
|
getByPage(page: RegisteredPage) {
|
||||||
return this.getItems().find((item) => item.target?.pageId == page.id && item.target?.extensionId === page.extensionId);
|
return this.getItems().find(item => item.target?.pageId == page.id && item.target?.extensionId === page.extensionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export class ClusterManager extends Singleton {
|
|||||||
super();
|
super();
|
||||||
// auto-init clusters
|
// auto-init clusters
|
||||||
autorun(() => {
|
autorun(() => {
|
||||||
clusterStore.enabledClustersList.forEach(cluster => {
|
clusterStore.enabledClustersList.forEach((cluster) => {
|
||||||
if (!cluster.initialized) {
|
if (!cluster.initialized) {
|
||||||
logger.info(`[CLUSTER-MANAGER]: init cluster`, cluster.getMeta());
|
logger.info(`[CLUSTER-MANAGER]: init cluster`, cluster.getMeta());
|
||||||
cluster.init(port);
|
cluster.init(port);
|
||||||
@ -46,7 +46,7 @@ export class ClusterManager extends Singleton {
|
|||||||
if (!cluster.disconnected) {
|
if (!cluster.disconnected) {
|
||||||
cluster.online = false;
|
cluster.online = false;
|
||||||
cluster.accessible = false;
|
cluster.accessible = false;
|
||||||
cluster.refreshConnectionStatus().catch((e) => e);
|
cluster.refreshConnectionStatus().catch(e => e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ export class ClusterManager extends Singleton {
|
|||||||
logger.info("[CLUSTER-MANAGER]: network is online");
|
logger.info("[CLUSTER-MANAGER]: network is online");
|
||||||
clusterStore.enabledClustersList.forEach((cluster) => {
|
clusterStore.enabledClustersList.forEach((cluster) => {
|
||||||
if (!cluster.disconnected) {
|
if (!cluster.disconnected) {
|
||||||
cluster.refreshConnectionStatus().catch((e) => e);
|
cluster.refreshConnectionStatus().catch(e => e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,7 +147,7 @@ export class Cluster implements ClusterModel, ClusterState {
|
|||||||
if (ipcMain) {
|
if (ipcMain) {
|
||||||
this.eventDisposers.push(
|
this.eventDisposers.push(
|
||||||
reaction(() => this.getState(), () => this.pushState()),
|
reaction(() => this.getState(), () => this.pushState()),
|
||||||
reaction(() => this.prometheusPreferences, (prefs) => this.contextHandler.setupPrometheus(prefs), { equals: comparer.structural, }),
|
reaction(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: comparer.structural, }),
|
||||||
() => {
|
() => {
|
||||||
clearInterval(refreshTimer);
|
clearInterval(refreshTimer);
|
||||||
clearInterval(refreshMetadataTimer);
|
clearInterval(refreshMetadataTimer);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ export class ContextHandler {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
timeout,
|
timeout,
|
||||||
headers: {
|
headers: {
|
||||||
"Host": this.clusterUrl.hostname,
|
Host: this.clusterUrl.hostname,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,7 +129,7 @@ export class LensBinary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async untarBinary() {
|
protected async untarBinary() {
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>((resolve) => {
|
||||||
this.logger.debug(`Extracting ${this.originalBinaryName} binary`);
|
this.logger.debug(`Extracting ${this.originalBinaryName} binary`);
|
||||||
tar.x({
|
tar.x({
|
||||||
file: this.tarPath,
|
file: this.tarPath,
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export class LensProxy {
|
|||||||
const key = req.rawHeaders[i];
|
const key = req.rawHeaders[i];
|
||||||
|
|
||||||
if (key !== "Host" && key !== "Authorization") {
|
if (key !== "Host" && key !== "Authorization") {
|
||||||
proxySocket.write(`${req.rawHeaders[i]}: ${req.rawHeaders[i+1]}\r\n`);
|
proxySocket.write(`${req.rawHeaders[i]}: ${req.rawHeaders[i + 1]}\r\n`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxySocket.write("\r\n");
|
proxySocket.write("\r\n");
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export function buildMenu(windowManager: WindowManager) {
|
|||||||
|
|
||||||
function activeClusterOnly(menuItems: MenuItemConstructorOptions[]) {
|
function activeClusterOnly(menuItems: MenuItemConstructorOptions[]) {
|
||||||
if (!windowManager.activeClusterId) {
|
if (!windowManager.activeClusterId) {
|
||||||
menuItems.forEach(item => {
|
menuItems.forEach((item) => {
|
||||||
item.enabled = false;
|
item.enabled = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export async function getFreePort(): Promise<number> {
|
|||||||
server.close(() => resolve(port));
|
server.close(() => resolve(port));
|
||||||
logger.debug(`New port found: ${port}`);
|
logger.debug(`New port found: ${port}`);
|
||||||
});
|
});
|
||||||
server.on("error", error => {
|
server.on("error", (error) => {
|
||||||
logger.error(`Can't resolve new port: "${error}"`);
|
logger.error(`Can't resolve new port: "${error}"`);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,8 +11,8 @@ function generateKubeConfig(username: string, secret: V1Secret, cluster: Cluster
|
|||||||
"kind": "Config",
|
"kind": "Config",
|
||||||
"clusters": [
|
"clusters": [
|
||||||
{
|
{
|
||||||
"name": cluster.contextName,
|
name: cluster.contextName,
|
||||||
"cluster": {
|
cluster: {
|
||||||
"server": cluster.apiUrl,
|
"server": cluster.apiUrl,
|
||||||
"certificate-authority-data": secret.data["ca.crt"]
|
"certificate-authority-data": secret.data["ca.crt"]
|
||||||
}
|
}
|
||||||
@ -20,19 +20,19 @@ function generateKubeConfig(username: string, secret: V1Secret, cluster: Cluster
|
|||||||
],
|
],
|
||||||
"users": [
|
"users": [
|
||||||
{
|
{
|
||||||
"name": username,
|
name: username,
|
||||||
"user": {
|
user: {
|
||||||
"token": tokenData.toString("utf8"),
|
token: tokenData.toString("utf8"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contexts": [
|
"contexts": [
|
||||||
{
|
{
|
||||||
"name": cluster.contextName,
|
name: cluster.contextName,
|
||||||
"context": {
|
context: {
|
||||||
"user": username,
|
user: username,
|
||||||
"cluster": cluster.contextName,
|
cluster: cluster.contextName,
|
||||||
"namespace": secret.metadata.namespace,
|
namespace: secret.metadata.namespace,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -46,7 +46,7 @@ class KubeconfigRoute extends LensApi {
|
|||||||
const { params, response, cluster} = request;
|
const { params, response, cluster} = request;
|
||||||
const client = cluster.getProxyKubeconfig().makeApiClient(CoreV1Api);
|
const client = cluster.getProxyKubeconfig().makeApiClient(CoreV1Api);
|
||||||
const secretList = await client.listNamespacedSecret(params.namespace);
|
const secretList = await client.listNamespacedSecret(params.namespace);
|
||||||
const secret = secretList.body.items.find(secret => {
|
const secret = secretList.body.items.find((secret) => {
|
||||||
const { annotations } = secret.metadata;
|
const { annotations } = secret.metadata;
|
||||||
|
|
||||||
return annotations && annotations["kubernetes.io/service-account.name"] == params.account;
|
return annotations && annotations["kubernetes.io/service-account.name"] == params.account;
|
||||||
|
|||||||
@ -92,7 +92,7 @@ class WatchRoute extends LensApi {
|
|||||||
response.setHeader("Connection", "keep-alive");
|
response.setHeader("Connection", "keep-alive");
|
||||||
logger.debug(`watch using kubeconfig:${JSON.stringify(cluster.getProxyKubeconfig(), null, 2)}`);
|
logger.debug(`watch using kubeconfig:${JSON.stringify(cluster.getProxyKubeconfig(), null, 2)}`);
|
||||||
|
|
||||||
apis.forEach(apiUrl => {
|
apis.forEach((apiUrl) => {
|
||||||
const watcher = new ApiWatcher(apiUrl, cluster.getProxyKubeconfig(), response);
|
const watcher = new ApiWatcher(apiUrl, cluster.getProxyKubeconfig(), response);
|
||||||
|
|
||||||
watcher.start();
|
watcher.start();
|
||||||
|
|||||||
@ -183,7 +183,7 @@ export class ShellSession extends EventEmitter {
|
|||||||
|
|
||||||
if (exitCode > 0) {
|
if (exitCode > 0) {
|
||||||
this.sendResponse("Terminal will auto-close in 15 seconds ...");
|
this.sendResponse("Terminal will auto-close in 15 seconds ...");
|
||||||
timeout = 15*1000;
|
timeout = 15 * 1000;
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.exit();
|
this.exit();
|
||||||
|
|||||||
@ -83,13 +83,13 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
|
|||||||
label: "Clusters",
|
label: "Clusters",
|
||||||
submenu: workspaceStore.enabledWorkspacesList
|
submenu: workspaceStore.enabledWorkspacesList
|
||||||
.filter(workspace => clusterStore.getByWorkspaceId(workspace.id).length > 0) // hide empty workspaces
|
.filter(workspace => clusterStore.getByWorkspaceId(workspace.id).length > 0) // hide empty workspaces
|
||||||
.map(workspace => {
|
.map((workspace) => {
|
||||||
const clusters = clusterStore.getByWorkspaceId(workspace.id);
|
const clusters = clusterStore.getByWorkspaceId(workspace.id);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label: workspace.name,
|
label: workspace.name,
|
||||||
toolTip: workspace.description,
|
toolTip: workspace.description,
|
||||||
submenu: clusters.map(cluster => {
|
submenu: clusters.map((cluster) => {
|
||||||
const { id: clusterId, name: label, online, workspace } = cluster;
|
const { id: clusterId, name: label, online, workspace } = cluster;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export default migration({
|
|||||||
|
|
||||||
printLog("Number of clusters to migrate: ", storedClusters.length);
|
printLog("Number of clusters to migrate: ", storedClusters.length);
|
||||||
const migratedClusters = storedClusters
|
const migratedClusters = storedClusters
|
||||||
.map(cluster => {
|
.map((cluster) => {
|
||||||
/**
|
/**
|
||||||
* migrate kubeconfig
|
* migrate kubeconfig
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default migration({
|
|||||||
|
|
||||||
printLog("Number of clusters to migrate: ", storedClusters.length);
|
printLog("Number of clusters to migrate: ", storedClusters.length);
|
||||||
const migratedClusters = storedClusters
|
const migratedClusters = storedClusters
|
||||||
.map(cluster => {
|
.map((cluster) => {
|
||||||
/**
|
/**
|
||||||
* replace snap version with 'current' in kubeconfig path
|
* replace snap version with 'current' in kubeconfig path
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class ApiManager {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
registerStore(store: KubeObjectStore, apis: KubeApi[] = [store.api]) {
|
registerStore(store: KubeObjectStore, apis: KubeApi[] = [store.api]) {
|
||||||
apis.forEach(api => {
|
apis.forEach((api) => {
|
||||||
this.stores.set(api, store);
|
this.stores.set(api, store);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@ export class CustomResourceDefinition extends KubeObject {
|
|||||||
getConditions() {
|
getConditions() {
|
||||||
if (!this.status?.conditions) return [];
|
if (!this.status?.conditions) return [];
|
||||||
|
|
||||||
return this.status.conditions.map(condition => {
|
return this.status.conditions.map((condition) => {
|
||||||
const { message, reason, lastTransitionTime, status } = condition;
|
const { message, reason, lastTransitionTime, status } = condition;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -88,12 +88,12 @@ export class EndpointSubset implements IEndpointSubset {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.addresses.map(address => {
|
return this.addresses.map((address) => {
|
||||||
if (!this.ports) {
|
if (!this.ports) {
|
||||||
return address.ip;
|
return address.ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.ports.map(port => {
|
return this.ports.map((port) => {
|
||||||
return `${address.ip}:${port.port}`;
|
return `${address.ip}:${port.port}`;
|
||||||
}).join(", ");
|
}).join(", ");
|
||||||
}).join(", ");
|
}).join(", ");
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export const helmChartsApi = {
|
|||||||
list() {
|
list() {
|
||||||
return apiBase
|
return apiBase
|
||||||
.get<IHelmChartList>(endpoint())
|
.get<IHelmChartList>(endpoint())
|
||||||
.then(data => {
|
.then((data) => {
|
||||||
return Object
|
return Object
|
||||||
.values(data)
|
.values(data)
|
||||||
.reduce((allCharts, repoCharts) => allCharts.concat(Object.values(repoCharts)), [])
|
.reduce((allCharts, repoCharts) => allCharts.concat(Object.values(repoCharts)), [])
|
||||||
@ -36,7 +36,7 @@ export const helmChartsApi = {
|
|||||||
|
|
||||||
return apiBase
|
return apiBase
|
||||||
.get<IHelmChartDetails>(`${path}?${stringify({ version: readmeVersion })}`)
|
.get<IHelmChartDetails>(`${path}?${stringify({ version: readmeVersion })}`)
|
||||||
.then(data => {
|
.then((data) => {
|
||||||
const versions = data.versions.map(HelmChart.create);
|
const versions = data.versions.map(HelmChart.create);
|
||||||
const readme = data.readme;
|
const readme = data.readme;
|
||||||
|
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export const helmReleasesApi = {
|
|||||||
get(name: string, namespace: string) {
|
get(name: string, namespace: string) {
|
||||||
const path = endpoint({ name, namespace });
|
const path = endpoint({ name, namespace });
|
||||||
|
|
||||||
return apiBase.get<IReleaseRawDetails>(path).then(details => {
|
return apiBase.get<IReleaseRawDetails>(path).then((details) => {
|
||||||
const items: KubeObject[] = JSON.parse(details.resources).items;
|
const items: KubeObject[] = JSON.parse(details.resources).items;
|
||||||
const resources = items.map(item => KubeObject.create(item));
|
const resources = items.map(item => KubeObject.create(item));
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ export class HorizontalPodAutoscaler extends KubeObject {
|
|||||||
getConditions() {
|
getConditions() {
|
||||||
if (!this.status.conditions) return [];
|
if (!this.status.conditions) return [];
|
||||||
|
|
||||||
return this.status.conditions.map(condition => {
|
return this.status.conditions.map((condition) => {
|
||||||
const { message, reason, lastTransitionTime, status } = condition;
|
const { message, reason, lastTransitionTime, status } = condition;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -108,11 +108,11 @@ export class Ingress extends KubeObject {
|
|||||||
if (tls && tls.length > 0) {
|
if (tls && tls.length > 0) {
|
||||||
protocol += "s";
|
protocol += "s";
|
||||||
}
|
}
|
||||||
rules.map(rule => {
|
rules.map((rule) => {
|
||||||
const host = rule.host ? rule.host : "*";
|
const host = rule.host ? rule.host : "*";
|
||||||
|
|
||||||
if (rule.http && rule.http.paths) {
|
if (rule.http && rule.http.paths) {
|
||||||
rule.http.paths.forEach(path => {
|
rule.http.paths.forEach((path) => {
|
||||||
const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);
|
const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);
|
||||||
|
|
||||||
routes.push(`${protocol}://${host}${path.path || "/"} ⇢ ${serviceName}:${servicePort}`);
|
routes.push(`${protocol}://${host}${path.path || "/"} ⇢ ${serviceName}:${servicePort}`);
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export const metricsApi = {
|
|||||||
data: query,
|
data: query,
|
||||||
query: {
|
query: {
|
||||||
start, end, step,
|
start, end, step,
|
||||||
"kubernetes_namespace": namespace,
|
kubernetes_namespace: namespace,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -75,7 +75,7 @@ export function normalizeMetrics(metrics: IMetrics, frames = 60): IMetrics {
|
|||||||
if (result.length) {
|
if (result.length) {
|
||||||
if (frames > 0) {
|
if (frames > 0) {
|
||||||
// fill the gaps
|
// fill the gaps
|
||||||
result.forEach(res => {
|
result.forEach((res) => {
|
||||||
if (!res.values || !res.values.length) return;
|
if (!res.values || !res.values.length) return;
|
||||||
|
|
||||||
while (res.values.length < frames) {
|
while (res.values.length < frames) {
|
||||||
@ -121,7 +121,7 @@ export function getItemMetrics(metrics: { [key: string]: IMetrics }, itemName: s
|
|||||||
export function getMetricLastPoints(metrics: { [key: string]: IMetrics }) {
|
export function getMetricLastPoints(metrics: { [key: string]: IMetrics }) {
|
||||||
const result: Partial<{ [metric: string]: number }> = {};
|
const result: Partial<{ [metric: string]: number }> = {};
|
||||||
|
|
||||||
Object.keys(metrics).forEach(metricName => {
|
Object.keys(metrics).forEach((metricName) => {
|
||||||
try {
|
try {
|
||||||
const metric = metrics[metricName];
|
const metric = metrics[metricName];
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ export class Node extends KubeObject {
|
|||||||
getWarningConditions() {
|
getWarningConditions() {
|
||||||
const goodConditions = ["Ready", "HostUpgrades", "SchedulingDisabled"];
|
const goodConditions = ["Ready", "HostUpgrades", "SchedulingDisabled"];
|
||||||
|
|
||||||
return this.getActiveConditions().filter(condition => {
|
return this.getActiveConditions().filter((condition) => {
|
||||||
return !goodConditions.includes(condition.type);
|
return !goodConditions.includes(condition.type);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export class PersistentVolumeClaim extends KubeObject {
|
|||||||
getPods(allPods: Pod[]): Pod[] {
|
getPods(allPods: Pod[]): Pod[] {
|
||||||
const pods = allPods.filter(pod => pod.getNs() === this.getNs());
|
const pods = allPods.filter(pod => pod.getNs() === this.getNs());
|
||||||
|
|
||||||
return pods.filter(pod => {
|
return pods.filter((pod) => {
|
||||||
return pod.getVolumes().filter(volume =>
|
return pod.getVolumes().filter(volume =>
|
||||||
volume.persistentVolumeClaim &&
|
volume.persistentVolumeClaim &&
|
||||||
volume.persistentVolumeClaim.claimName === this.getName()
|
volume.persistentVolumeClaim.claimName === this.getName()
|
||||||
|
|||||||
@ -249,7 +249,7 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
getRunningContainers() {
|
getRunningContainers() {
|
||||||
const statuses = this.getContainerStatuses();
|
const statuses = this.getContainerStatuses();
|
||||||
|
|
||||||
return this.getAllContainers().filter(container => {
|
return this.getAllContainers().filter((container) => {
|
||||||
return statuses.find(status => status.name === container.name && !!status.state["running"]);
|
return statuses.find(status => status.name === container.name && !!status.state["running"]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -326,7 +326,7 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
const statuses = this.getContainerStatuses(false); // not including initContainers
|
const statuses = this.getContainerStatuses(false); // not including initContainers
|
||||||
|
|
||||||
if (statuses.length) {
|
if (statuses.length) {
|
||||||
statuses.forEach(status => {
|
statuses.forEach((status) => {
|
||||||
const { state } = status;
|
const { state } = status;
|
||||||
|
|
||||||
if (state.waiting) {
|
if (state.waiting) {
|
||||||
@ -382,10 +382,10 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasIssues() {
|
hasIssues() {
|
||||||
const notReady = !!this.getConditions().find(condition => {
|
const notReady = !!this.getConditions().find((condition) => {
|
||||||
return condition.type == "Ready" && condition.status !== "True";
|
return condition.type == "Ready" && condition.status !== "True";
|
||||||
});
|
});
|
||||||
const crashLoop = !!this.getContainerStatuses().find(condition => {
|
const crashLoop = !!this.getContainerStatuses().find((condition) => {
|
||||||
const waiting = condition.state.waiting;
|
const waiting = condition.state.waiting;
|
||||||
|
|
||||||
return (waiting && waiting.reason == "CrashLoopBackOff");
|
return (waiting && waiting.reason == "CrashLoopBackOff");
|
||||||
|
|||||||
@ -16,8 +16,8 @@ export const resourceApplierApi = {
|
|||||||
|
|
||||||
return apiBase
|
return apiBase
|
||||||
.post<KubeJsonApiData[]>("/stack", { data: resource })
|
.post<KubeJsonApiData[]>("/stack", { data: resource })
|
||||||
.then(data => {
|
.then((data) => {
|
||||||
const items = data.map(obj => {
|
const items = data.map((obj) => {
|
||||||
const api = apiManager.getApi(obj.metadata.selfLink);
|
const api = apiManager.getApi(obj.metadata.selfLink);
|
||||||
|
|
||||||
if (api) {
|
if (api) {
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export class JsonApi<D = JsonApiData, P extends JsonApiParams = JsonApiParams> {
|
|||||||
reqInit,
|
reqInit,
|
||||||
};
|
};
|
||||||
|
|
||||||
return cancelableFetch(reqUrl, reqInit).then(res => {
|
return cancelableFetch(reqUrl, reqInit).then((res) => {
|
||||||
return this.parseResponse<D>(res, infoLog);
|
return this.parseResponse<D>(res, infoLog);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ export class JsonApi<D = JsonApiData, P extends JsonApiParams = JsonApiParams> {
|
|||||||
protected parseResponse<D>(res: Response, log: JsonApiLog): Promise<D> {
|
protected parseResponse<D>(res: Response, log: JsonApiLog): Promise<D> {
|
||||||
const { status } = res;
|
const { status } = res;
|
||||||
|
|
||||||
return res.text().then(text => {
|
return res.text().then((text) => {
|
||||||
let data;
|
let data;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -124,7 +124,7 @@ export class KubeObject implements ItemObject {
|
|||||||
getAnnotations(filter = false): string[] {
|
getAnnotations(filter = false): string[] {
|
||||||
const labels = KubeObject.stringifyLabels(this.metadata.annotations);
|
const labels = KubeObject.stringifyLabels(this.metadata.annotations);
|
||||||
|
|
||||||
return filter ? labels.filter(label => {
|
return filter ? labels.filter((label) => {
|
||||||
const skip = resourceApplierApi.annotations.some(key => label.startsWith(key));
|
const skip = resourceApplierApi.annotations.some(key => label.startsWith(key));
|
||||||
|
|
||||||
return !skip;
|
return !skip;
|
||||||
|
|||||||
@ -50,11 +50,11 @@ export class KubeWatchApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
subscribe(...apis: KubeApi[]) {
|
subscribe(...apis: KubeApi[]) {
|
||||||
apis.forEach(api => {
|
apis.forEach((api) => {
|
||||||
this.subscribers.set(api, this.getSubscribersCount(api) + 1);
|
this.subscribers.set(api, this.getSubscribersCount(api) + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => apis.forEach(api => {
|
return () => apis.forEach((api) => {
|
||||||
const count = this.getSubscribersCount(api) - 1;
|
const count = this.getSubscribersCount(api) - 1;
|
||||||
|
|
||||||
if (count <= 0) this.subscribers.delete(api);
|
if (count <= 0) this.subscribers.delete(api);
|
||||||
@ -66,7 +66,7 @@ export class KubeWatchApi {
|
|||||||
const { isAdmin, allowedNamespaces } = getHostedCluster();
|
const { isAdmin, allowedNamespaces } = getHostedCluster();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
api: this.activeApis.map(api => {
|
api: this.activeApis.map((api) => {
|
||||||
if (isAdmin) return api.getWatchUrl();
|
if (isAdmin) return api.getWatchUrl();
|
||||||
|
|
||||||
return allowedNamespaces.map(namespace => api.getWatchUrl(namespace));
|
return allowedNamespaces.map(namespace => api.getWatchUrl(namespace));
|
||||||
|
|||||||
@ -106,7 +106,7 @@ export class AddCluster extends React.Component {
|
|||||||
getContexts(config: KubeConfig): Map<string, KubeConfig> {
|
getContexts(config: KubeConfig): Map<string, KubeConfig> {
|
||||||
const contexts = new Map();
|
const contexts = new Map();
|
||||||
|
|
||||||
splitConfig(config).forEach(config => {
|
splitConfig(config).forEach((config) => {
|
||||||
contexts.set(config.currentContext, config);
|
contexts.set(config.currentContext, config);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ export class AddCluster extends React.Component {
|
|||||||
this.error = "";
|
this.error = "";
|
||||||
this.isWaiting = true;
|
this.isWaiting = true;
|
||||||
appEventBus.emit({ name: "cluster-add", action: "click" });
|
appEventBus.emit({ name: "cluster-add", action: "click" });
|
||||||
newClusters = this.selectedContexts.filter(context => {
|
newClusters = this.selectedContexts.filter((context) => {
|
||||||
try {
|
try {
|
||||||
const kubeConfig = this.kubeContexts.get(context);
|
const kubeConfig = this.kubeContexts.get(context);
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ export class AddCluster extends React.Component {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).map(context => {
|
}).map((context) => {
|
||||||
const clusterId = uuid();
|
const clusterId = uuid();
|
||||||
const kubeConfig = this.kubeContexts.get(context);
|
const kubeConfig = this.kubeContexts.get(context);
|
||||||
const kubeConfigPath = this.sourceTab === KubeConfigSourceTab.FILE
|
const kubeConfigPath = this.sourceTab === KubeConfigSourceTab.FILE
|
||||||
@ -267,7 +267,7 @@ export class AddCluster extends React.Component {
|
|||||||
showGutter={false}
|
showGutter={false}
|
||||||
mode="yaml"
|
mode="yaml"
|
||||||
value={this.customConfig}
|
value={this.customConfig}
|
||||||
onChange={value => {
|
onChange={(value) => {
|
||||||
this.customConfig = value;
|
this.customConfig = value;
|
||||||
this.refreshContexts();
|
this.refreshContexts();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -38,12 +38,12 @@ export class HelmChartDetails extends Component<Props> {
|
|||||||
this.selectedChart = null;
|
this.selectedChart = null;
|
||||||
const { chart: { name, repo, version } } = this.props;
|
const { chart: { name, repo, version } } = this.props;
|
||||||
|
|
||||||
helmChartsApi.get(repo, name, version).then(result => {
|
helmChartsApi.get(repo, name, version).then((result) => {
|
||||||
this.readme = result.readme;
|
this.readme = result.readme;
|
||||||
this.chartVersions = result.versions;
|
this.chartVersions = result.versions;
|
||||||
this.selectedChart = result.versions[0];
|
this.selectedChart = result.versions[0];
|
||||||
},
|
},
|
||||||
error => {
|
(error) => {
|
||||||
this.error = error;
|
this.error = error;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -79,7 +79,7 @@ export class HelmChartDetails extends Component<Props> {
|
|||||||
<img
|
<img
|
||||||
className="intro-logo"
|
className="intro-logo"
|
||||||
src={selectedChart.getIcon() || placeholder}
|
src={selectedChart.getIcon() || placeholder}
|
||||||
onError={(event) => event.currentTarget.src = placeholder}
|
onError={event => event.currentTarget.src = placeholder}
|
||||||
/>
|
/>
|
||||||
<div className="intro-contents box grow">
|
<div className="intro-contents box grow">
|
||||||
<div className="description flex align-center justify-space-between">
|
<div className="description flex align-center justify-space-between">
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class ReleaseDetails extends Component<Props> {
|
|||||||
@observable releaseSecret: Secret;
|
@observable releaseSecret: Secret;
|
||||||
|
|
||||||
@disposeOnUnmount
|
@disposeOnUnmount
|
||||||
releaseSelector = reaction(() => this.props.release, release => {
|
releaseSelector = reaction(() => this.props.release, (release) => {
|
||||||
if (!release) return;
|
if (!release) return;
|
||||||
this.loadDetails();
|
this.loadDetails();
|
||||||
this.loadValues();
|
this.loadValues();
|
||||||
@ -157,7 +157,7 @@ export class ReleaseDetails extends Component<Props> {
|
|||||||
{items[0].getNs() && <TableCell className="namespace">Namespace</TableCell>}
|
{items[0].getNs() && <TableCell className="namespace">Namespace</TableCell>}
|
||||||
<TableCell className="age">Age</TableCell>
|
<TableCell className="age">Age</TableCell>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
{items.map(item => {
|
{items.map((item) => {
|
||||||
const name = item.getName();
|
const name = item.getName();
|
||||||
const namespace = item.getNs();
|
const namespace = item.getNs();
|
||||||
const api = apiManager.getApi(item.metadata.selfLink);
|
const api = apiManager.getApi(item.metadata.selfLink);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export class ReleaseStore extends ItemStore<HelmRelease> {
|
|||||||
if (this.isLoading) return;
|
if (this.isLoading) return;
|
||||||
const secrets = this.getReleaseSecrets();
|
const secrets = this.getReleaseSecrets();
|
||||||
const amountChanged = secrets.length !== this.releaseSecrets.length;
|
const amountChanged = secrets.length !== this.releaseSecrets.length;
|
||||||
const labelsChanged = this.releaseSecrets.some(item => {
|
const labelsChanged = this.releaseSecrets.some((item) => {
|
||||||
const secret = secrets.find(secret => secret.getId() == item.getId());
|
const secret = secrets.find(secret => secret.getId() == item.getId());
|
||||||
|
|
||||||
if (!secret) return;
|
if (!secret) return;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export class HelmReleases extends Component<Props> {
|
|||||||
get selectedRelease() {
|
get selectedRelease() {
|
||||||
const { match: { params: { name, namespace } } } = this.props;
|
const { match: { params: { name, namespace } } } = this.props;
|
||||||
|
|
||||||
return releaseStore.items.find(release => {
|
return releaseStore.items.find((release) => {
|
||||||
return release.getName() == name && release.getNs() == namespace;
|
return release.getName() == name && release.getNs() == namespace;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ export class ClusterPrometheusSetting extends React.Component<Props> {
|
|||||||
<Input
|
<Input
|
||||||
theme="round-black"
|
theme="round-black"
|
||||||
value={this.path}
|
value={this.path}
|
||||||
onChange={(value) => this.path = value}
|
onChange={value => this.path = value}
|
||||||
onBlur={this.onSavePath}
|
onBlur={this.onSavePath}
|
||||||
placeholder="<namespace>/<service>:<port>"
|
placeholder="<namespace>/<service>:<port>"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class Features extends React.Component<Props> {
|
|||||||
{
|
{
|
||||||
clusterFeatureRegistry
|
clusterFeatureRegistry
|
||||||
.getItems()
|
.getItems()
|
||||||
.map((f) => (
|
.map(f => (
|
||||||
<InstallFeature key={f.title} cluster={cluster} feature={f.feature}>
|
<InstallFeature key={f.title} cluster={cluster} feature={f.feature}>
|
||||||
<>
|
<>
|
||||||
<SubTitle title={f.title} />
|
<SubTitle title={f.title} />
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export class ClusterIssues extends React.Component<Props> {
|
|||||||
const warnings: IWarning[] = [];
|
const warnings: IWarning[] = [];
|
||||||
|
|
||||||
// Node bad conditions
|
// Node bad conditions
|
||||||
nodesStore.items.forEach(node => {
|
nodesStore.items.forEach((node) => {
|
||||||
const { kind, selfLink, getId, getName } = node;
|
const { kind, selfLink, getId, getName } = node;
|
||||||
|
|
||||||
node.getWarningConditions().forEach(({ message }) => {
|
node.getWarningConditions().forEach(({ message }) => {
|
||||||
@ -59,7 +59,7 @@ export class ClusterIssues extends React.Component<Props> {
|
|||||||
// Warning events for Workloads
|
// Warning events for Workloads
|
||||||
const events = eventStore.getWarnings();
|
const events = eventStore.getWarnings();
|
||||||
|
|
||||||
events.forEach(error => {
|
events.forEach((error) => {
|
||||||
const { message, involvedObject } = error;
|
const { message, involvedObject } = error;
|
||||||
const { uid, name, kind } = involvedObject;
|
const { uid, name, kind } = involvedObject;
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export const ClusterMetrics = observer(() => {
|
|||||||
yAxes: [{
|
yAxes: [{
|
||||||
ticks: {
|
ticks: {
|
||||||
suggestedMax: cpuCapacity,
|
suggestedMax: cpuCapacity,
|
||||||
callback: (value) => value
|
callback: value => value
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -136,7 +136,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "HorizontalPodAutoscaler",
|
kind: "HorizontalPodAutoscaler",
|
||||||
apiVersions: ["autoscaling/v1"],
|
apiVersions: ["autoscaling/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <HpaDetails {...props} />
|
Details: props => <HpaDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,6 +145,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["autoscaling/v1"],
|
apiVersions: ["autoscaling/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -100,7 +100,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "ConfigMap",
|
kind: "ConfigMap",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <ConfigMapDetails {...props} />
|
Details: props => <ConfigMapDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "PodDisruptionBudget",
|
kind: "PodDisruptionBudget",
|
||||||
apiVersions: ["policy/v1beta1"],
|
apiVersions: ["policy/v1beta1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <PodDisruptionBudgetDetails {...props} />
|
Details: props => <PodDisruptionBudgetDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -67,7 +67,7 @@ export class AddQuotaDialog extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get quotaOptions() {
|
@computed get quotaOptions() {
|
||||||
return Object.keys(this.quotas).map(quota => {
|
return Object.keys(this.quotas).map((quota) => {
|
||||||
const isCompute = quota.endsWith(".cpu") || quota.endsWith(".memory");
|
const isCompute = quota.endsWith(".cpu") || quota.endsWith(".memory");
|
||||||
const isStorage = quota.endsWith(".storage") || quota === "persistentvolumeclaims";
|
const isStorage = quota.endsWith(".storage") || quota === "persistentvolumeclaims";
|
||||||
const isCount = quota.startsWith("count/");
|
const isCount = quota.startsWith("count/");
|
||||||
|
|||||||
@ -102,6 +102,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "ResourceQuota",
|
kind: "ResourceQuota",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <ResourceQuotaDetails {...props} />
|
Details: props => <ResourceQuotaDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -124,6 +124,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Secret",
|
kind: "Secret",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <SecretDetails {...props} />
|
Details: props => <SecretDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -60,7 +60,7 @@ export class CRDDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
||||||
{
|
{
|
||||||
crd.getConditions().map(condition => {
|
crd.getConditions().map((condition) => {
|
||||||
const { type, message, lastTransitionTime, status } = condition;
|
const { type, message, lastTransitionTime, status } = condition;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -141,6 +141,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "CustomResourceDefinition",
|
kind: "CustomResourceDefinition",
|
||||||
apiVersions: ["apiextensions.k8s.io/v1", "apiextensions.k8s.io/v1beta1"],
|
apiVersions: ["apiextensions.k8s.io/v1", "apiextensions.k8s.io/v1beta1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <CRDDetails {...props} />
|
Details: props => <CRDDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -60,7 +60,7 @@ export class CrdResources extends React.Component<Props> {
|
|||||||
[sortBy.age]: (item: KubeObject) => item.metadata.creationTimestamp,
|
[sortBy.age]: (item: KubeObject) => item.metadata.creationTimestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
extraColumns.forEach(column => {
|
extraColumns.forEach((column) => {
|
||||||
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, column.jsonPath.slice(1));
|
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, column.jsonPath.slice(1));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ export class CrdResources extends React.Component<Props> {
|
|||||||
renderTableHeader={[
|
renderTableHeader={[
|
||||||
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
||||||
isNamespaced && { title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
isNamespaced && { title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
||||||
...extraColumns.map(column => {
|
...extraColumns.map((column) => {
|
||||||
const { name } = column;
|
const { name } = column;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -80,6 +80,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Event",
|
kind: "Event",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <EventDetails {...props}/>
|
Details: props => <EventDetails {...props}/>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export class EventStore extends KubeObjectStore<KubeEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEventsByObject(obj: KubeObject): KubeEvent[] {
|
getEventsByObject(obj: KubeObject): KubeEvent[] {
|
||||||
return this.items.filter(evt => {
|
return this.items.filter((evt) => {
|
||||||
if(obj.kind == "Node") {
|
if(obj.kind == "Node") {
|
||||||
return obj.getName() == evt.involvedObject.uid && evt.involvedObject.kind == "Node";
|
return obj.getName() == evt.involvedObject.uid && evt.involvedObject.kind == "Node";
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ export class EventStore extends KubeObjectStore<KubeEvent> {
|
|||||||
getWarnings() {
|
getWarnings() {
|
||||||
const warnings = this.items.filter(event => event.type == "Warning");
|
const warnings = this.items.filter(event => event.type == "Warning");
|
||||||
const groupsByInvolvedObject = groupBy(warnings, warning => warning.involvedObject.uid);
|
const groupsByInvolvedObject = groupBy(warnings, warning => warning.involvedObject.uid);
|
||||||
const eventsWithError = Object.values(groupsByInvolvedObject).map(events => {
|
const eventsWithError = Object.values(groupsByInvolvedObject).map((events) => {
|
||||||
const recent = events[0];
|
const recent = events[0];
|
||||||
const { kind, uid } = recent.involvedObject;
|
const { kind, uid } = recent.involvedObject;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
|||||||
<span><Trans>Events</Trans></span>
|
<span><Trans>Events</Trans></span>
|
||||||
</DrawerTitle>
|
</DrawerTitle>
|
||||||
<div className="KubeEventDetails">
|
<div className="KubeEventDetails">
|
||||||
{events.map(evt => {
|
{events.map((evt) => {
|
||||||
const { message, count, lastTimestamp, involvedObject } = evt;
|
const { message, count, lastTimestamp, involvedObject } = evt;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -116,7 +116,7 @@ export class Extensions extends React.Component {
|
|||||||
@computed get extensions() {
|
@computed get extensions() {
|
||||||
const searchText = this.search.toLowerCase();
|
const searchText = this.search.toLowerCase();
|
||||||
|
|
||||||
return Array.from(extensionLoader.userExtensions.values()).filter(ext => {
|
return Array.from(extensionLoader.userExtensions.values()).filter((ext) => {
|
||||||
const { name, description } = ext.manifest;
|
const { name, description } = ext.manifest;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -206,7 +206,7 @@ export class Extensions extends React.Component {
|
|||||||
await Promise.all(
|
await Promise.all(
|
||||||
requests
|
requests
|
||||||
.filter(request => !request.data && request.filePath)
|
.filter(request => !request.data && request.filePath)
|
||||||
.map(async request => {
|
.map(async (request) => {
|
||||||
try {
|
try {
|
||||||
const data = await fse.readFile(request.filePath);
|
const data = await fse.readFile(request.filePath);
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ export class Extensions extends React.Component {
|
|||||||
|
|
||||||
// validate packages
|
// validate packages
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
requests.map(async req => {
|
requests.map(async (req) => {
|
||||||
const tempFile = this.getExtensionPackageTemp(req.fileName);
|
const tempFile = this.getExtensionPackageTemp(req.fileName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -442,7 +442,7 @@ export class Extensions extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return extensions.map(extension => {
|
return extensions.map((extension) => {
|
||||||
const { id, isEnabled, manifest } = extension;
|
const { id, isEnabled, manifest } = extension;
|
||||||
const { name, description } = manifest;
|
const { name, description } = manifest;
|
||||||
const isUninstalling = this.extensionState.get(id)?.state === "uninstalling";
|
const isUninstalling = this.extensionState.get(id)?.state === "uninstalling";
|
||||||
@ -538,7 +538,7 @@ export class Extensions extends React.Component {
|
|||||||
<SearchInput
|
<SearchInput
|
||||||
placeholder="Search installed extensions by name or description"
|
placeholder="Search installed extensions by name or description"
|
||||||
value={this.search}
|
value={this.search}
|
||||||
onChange={(value) => this.search = value}
|
onChange={value => this.search = value}
|
||||||
/>
|
/>
|
||||||
{this.renderExtensions()}
|
{this.renderExtensions()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export class NamespaceDetails extends React.Component<Props> {
|
|||||||
|
|
||||||
<DrawerItem name={<Trans>Resource Quotas</Trans>} className="quotas flex align-center">
|
<DrawerItem name={<Trans>Resource Quotas</Trans>} className="quotas flex align-center">
|
||||||
{!this.quotas && resourceQuotaStore.isLoading && <Spinner/>}
|
{!this.quotas && resourceQuotaStore.isLoading && <Spinner/>}
|
||||||
{this.quotas.map(quota => {
|
{this.quotas.map((quota) => {
|
||||||
return (
|
return (
|
||||||
<Link key={quota.getId()} to={getDetailsUrl(quota.selfLink)}>
|
<Link key={quota.getId()} to={getDetailsUrl(quota.selfLink)}>
|
||||||
{quota.getName()}
|
{quota.getName()}
|
||||||
@ -63,6 +63,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Namespace",
|
kind: "Namespace",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <NamespaceDetails {...props} />
|
Details: props => <NamespaceDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace> {
|
|||||||
this.updateUrl(namespaces);
|
this.updateUrl(namespaces);
|
||||||
|
|
||||||
// sync with local-storage & url-search-params
|
// sync with local-storage & url-search-params
|
||||||
reaction(() => this.contextNs.toJS(), namespaces => {
|
reaction(() => this.contextNs.toJS(), (namespaces) => {
|
||||||
this.storage.set(namespaces);
|
this.storage.set(namespaces);
|
||||||
this.updateUrl(namespaces);
|
this.updateUrl(namespaces);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export class EndpointDetails extends React.Component<Props> {
|
|||||||
<KubeObjectMeta object={endpoint}/>
|
<KubeObjectMeta object={endpoint}/>
|
||||||
<DrawerTitle title={<Trans>Subsets</Trans>}/>
|
<DrawerTitle title={<Trans>Subsets</Trans>}/>
|
||||||
{
|
{
|
||||||
endpoint.getEndpointSubsets().map((subset) => (
|
endpoint.getEndpointSubsets().map(subset => (
|
||||||
<EndpointSubsetList key={subset.toString()} subset={subset} endpoint={endpoint} />
|
<EndpointSubsetList key={subset.toString()} subset={subset} endpoint={endpoint} />
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Endpoints",
|
kind: "Endpoints",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <EndpointDetails {...props} />
|
Details: props => <EndpointDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -47,6 +47,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -145,7 +145,7 @@ export class EndpointSubsetList extends React.Component<Props> {
|
|||||||
<TableCell className="protocol">Protocol</TableCell>
|
<TableCell className="protocol">Protocol</TableCell>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
{
|
{
|
||||||
subset.ports.map(port => {
|
subset.ports.map((port) => {
|
||||||
return (
|
return (
|
||||||
<TableRow
|
<TableRow
|
||||||
key={port.port}
|
key={port.port}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export class IngressDetails extends React.Component<Props> {
|
|||||||
{
|
{
|
||||||
rule.http.paths.map((path, index) => {
|
rule.http.paths.map((path, index) => {
|
||||||
const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);
|
const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);
|
||||||
const backend =`${serviceName}:${servicePort}`;
|
const backend = `${serviceName}:${servicePort}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow key={index}>
|
<TableRow key={index}>
|
||||||
@ -146,7 +146,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Ingress",
|
kind: "Ingress",
|
||||||
apiVersions: ["networking.k8s.io/v1", "extensions/v1beta1"],
|
apiVersions: ["networking.k8s.io/v1", "extensions/v1beta1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <IngressDetails {...props} />
|
Details: props => <IngressDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -154,6 +154,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["networking.k8s.io/v1", "extensions/v1beta1"],
|
apiVersions: ["networking.k8s.io/v1", "extensions/v1beta1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export class NetworkPolicyDetails extends React.Component<Props> {
|
|||||||
<>
|
<>
|
||||||
<SubTitle title={<Trans>From</Trans>}/>
|
<SubTitle title={<Trans>From</Trans>}/>
|
||||||
{from.map(item =>
|
{from.map(item =>
|
||||||
Object.keys(item).map(key => {
|
Object.keys(item).map((key) => {
|
||||||
const data = get(item, key);
|
const data = get(item, key);
|
||||||
|
|
||||||
if (key === "ipBlock") {
|
if (key === "ipBlock") {
|
||||||
@ -76,7 +76,7 @@ export class NetworkPolicyDetails extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SubTitle title={<Trans>To</Trans>}/>
|
<SubTitle title={<Trans>To</Trans>}/>
|
||||||
{to.map(item => {
|
{to.map((item) => {
|
||||||
const { ipBlock } = item;
|
const { ipBlock } = item;
|
||||||
|
|
||||||
if (!ipBlock) return;
|
if (!ipBlock) return;
|
||||||
@ -161,7 +161,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "NetworkPolicy",
|
kind: "NetworkPolicy",
|
||||||
apiVersions: ["networking.k8s.io/v1"],
|
apiVersions: ["networking.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <NetworkPolicyDetails {...props} />
|
Details: props => <NetworkPolicyDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -170,6 +170,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["networking.k8s.io/v1"],
|
apiVersions: ["networking.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export class ServiceDetails extends React.Component<Props> {
|
|||||||
<DrawerItem name={<Trans>Ports</Trans>}>
|
<DrawerItem name={<Trans>Ports</Trans>}>
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
service.getPorts().map((port) => (
|
service.getPorts().map(port => (
|
||||||
<ServicePortComponent service={service} port={port} key={port.toString()}/>
|
<ServicePortComponent service={service} port={port} key={port.toString()}/>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Service",
|
kind: "Service",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <ServiceDetails {...props} />
|
Details: props => <ServiceDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,6 +98,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -121,7 +121,7 @@ export class NodeDetails extends React.Component<Props> {
|
|||||||
{conditions &&
|
{conditions &&
|
||||||
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
||||||
{
|
{
|
||||||
conditions.map(condition => {
|
conditions.map((condition) => {
|
||||||
const { type } = condition;
|
const { type } = condition;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -161,7 +161,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Node",
|
kind: "Node",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <NodeDetails {...props} />
|
Details: props => <NodeDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -170,6 +170,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -44,10 +44,10 @@ export class NodesStore extends KubeObjectStore<Node> {
|
|||||||
}
|
}
|
||||||
const nodeName = node.getName();
|
const nodeName = node.getName();
|
||||||
|
|
||||||
return metricNames.map(metricName => {
|
return metricNames.map((metricName) => {
|
||||||
try {
|
try {
|
||||||
const metric = this.metrics[metricName];
|
const metric = this.metrics[metricName];
|
||||||
const result = metric.data.result.find(result => {
|
const result = metric.data.result.find((result) => {
|
||||||
return [
|
return [
|
||||||
result.metric.node,
|
result.metric.node,
|
||||||
result.metric.instance,
|
result.metric.instance,
|
||||||
|
|||||||
@ -109,7 +109,7 @@ export class Nodes extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
const conditions = node.getActiveConditions();
|
const conditions = node.getActiveConditions();
|
||||||
|
|
||||||
return conditions.map(condition => {
|
return conditions.map((condition) => {
|
||||||
const { type } = condition;
|
const { type } = condition;
|
||||||
const tooltipId = `node-${node.getName()}-condition-${type}`;
|
const tooltipId = `node-${node.getName()}-condition-${type}`;
|
||||||
|
|
||||||
|
|||||||
@ -216,6 +216,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "PodSecurityPolicy",
|
kind: "PodSecurityPolicy",
|
||||||
apiVersions: ["policy/v1beta1"],
|
apiVersions: ["policy/v1beta1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <PodSecurityPolicyDetails {...props}/>
|
Details: props => <PodSecurityPolicyDetails {...props}/>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -66,7 +66,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "StorageClass",
|
kind: "StorageClass",
|
||||||
apiVersions: ["storage.k8s.io/v1"],
|
apiVersions: ["storage.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <StorageClassDetails {...props} />
|
Details: props => <StorageClassDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -75,6 +75,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["storage.k8s.io/v1"],
|
apiVersions: ["storage.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -99,7 +99,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "PersistentVolumeClaim",
|
kind: "PersistentVolumeClaim",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
Details: props => <PersistentVolumeClaimDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -108,6 +108,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -107,7 +107,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "PersistentVolume",
|
kind: "PersistentVolume",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <PersistentVolumeDetails {...props} />
|
Details: props => <PersistentVolumeDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -116,6 +116,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -165,7 +165,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
|||||||
roles = roles.filter(role => !role.getNs() || role.getNs() === this.bindContext);
|
roles = roles.filter(role => !role.getNs() || role.getNs() === this.bindContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
return roles.map(role => {
|
return roles.map((role) => {
|
||||||
const name = role.getName();
|
const name = role.getName();
|
||||||
const namespace = role.getNs();
|
const namespace = role.getNs();
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get serviceAccountOptions(): BindingSelectOption[] {
|
@computed get serviceAccountOptions(): BindingSelectOption[] {
|
||||||
return serviceAccountsStore.items.map(account => {
|
return serviceAccountsStore.items.map((account) => {
|
||||||
const name = account.getName();
|
const name = account.getName();
|
||||||
const namespace = account.getNs();
|
const namespace = account.getNs();
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "RoleBinding",
|
kind: "RoleBinding",
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <RoleBindingDetails {...props} />
|
Details: props => <RoleBindingDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -140,7 +140,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "ClusterRoleBinding",
|
kind: "ClusterRoleBinding",
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <RoleBindingDetails {...props} />
|
Details: props => <RoleBindingDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -157,6 +157,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -70,7 +70,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Role",
|
kind: "Role",
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <RoleDetails {...props}/>
|
Details: props => <RoleDetails {...props}/>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -78,7 +78,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "ClusterRole",
|
kind: "ClusterRole",
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <RoleDetails {...props}/>
|
Details: props => <RoleDetails {...props}/>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -94,6 +94,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props}/>
|
Details: props => <KubeEventDetails {...props}/>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -144,7 +144,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "ServiceAccount",
|
kind: "ServiceAccount",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <ServiceAccountsDetails {...props} />
|
Details: props => <ServiceAccountsDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -152,6 +152,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -93,7 +93,7 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "CronJob",
|
kind: "CronJob",
|
||||||
apiVersions: ["batch/v1"],
|
apiVersions: ["batch/v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <CronJobDetails {...props} />
|
Details: props => <CronJobDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
@ -101,6 +101,6 @@ kubeObjectDetailRegistry.add({
|
|||||||
apiVersions: ["batch/v1"],
|
apiVersions: ["batch/v1"],
|
||||||
priority: 5,
|
priority: 5,
|
||||||
components: {
|
components: {
|
||||||
Details: (props) => <KubeEventDetails {...props} />
|
Details: props => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export class CronJobStore extends KubeObjectStore<CronJob> {
|
|||||||
getStatuses(cronJobs?: CronJob[]) {
|
getStatuses(cronJobs?: CronJob[]) {
|
||||||
const status = { suspended: 0, scheduled: 0 };
|
const status = { suspended: 0, scheduled: 0 };
|
||||||
|
|
||||||
cronJobs.forEach(cronJob => {
|
cronJobs.forEach((cronJob) => {
|
||||||
if (cronJob.spec.suspend) {
|
if (cronJob.spec.suspend) {
|
||||||
status.suspended++;
|
status.suspended++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export class DaemonSetStore extends KubeObjectStore<DaemonSet> {
|
|||||||
getStatuses(daemonSets?: DaemonSet[]) {
|
getStatuses(daemonSets?: DaemonSet[]) {
|
||||||
const status = { failed: 0, pending: 0, running: 0 };
|
const status = { failed: 0, pending: 0, running: 0 };
|
||||||
|
|
||||||
daemonSets.forEach(daemonSet => {
|
daemonSets.forEach((daemonSet) => {
|
||||||
const pods = this.getChildPods(daemonSet);
|
const pods = this.getChildPods(daemonSet);
|
||||||
|
|
||||||
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
||||||
|
|||||||
@ -96,7 +96,7 @@ export class DeploymentDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
||||||
{
|
{
|
||||||
deployment.getConditions().map(condition => {
|
deployment.getConditions().map((condition) => {
|
||||||
const { type, message, lastTransitionTime, status } = condition;
|
const { type, message, lastTransitionTime, status } = condition;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export class DeploymentStore extends KubeObjectStore<Deployment> {
|
|||||||
getStatuses(deployments?: Deployment[]) {
|
getStatuses(deployments?: Deployment[]) {
|
||||||
const status = { failed: 0, pending: 0, running: 0 };
|
const status = { failed: 0, pending: 0, running: 0 };
|
||||||
|
|
||||||
deployments.forEach(deployment => {
|
deployments.forEach((deployment) => {
|
||||||
const pods = this.getChildPods(deployment);
|
const pods = this.getChildPods(deployment);
|
||||||
|
|
||||||
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export class JobDetails extends React.Component<Props> {
|
|||||||
{ownerRefs.length > 0 &&
|
{ownerRefs.length > 0 &&
|
||||||
<DrawerItem name={<Trans>Controlled by</Trans>}>
|
<DrawerItem name={<Trans>Controlled by</Trans>}>
|
||||||
{
|
{
|
||||||
ownerRefs.map(ref => {
|
ownerRefs.map((ref) => {
|
||||||
const { name, kind } = ref;
|
const { name, kind } = ref;
|
||||||
const detailsUrl = getDetailsUrl(lookupApiLink(ref, job));
|
const detailsUrl = getDetailsUrl(lookupApiLink(ref, job));
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export class JobStore extends KubeObjectStore<Job> {
|
|||||||
getStatuses(jobs?: Job[]) {
|
getStatuses(jobs?: Job[]) {
|
||||||
const status = { failed: 0, pending: 0, running: 0, succeeded: 0 };
|
const status = { failed: 0, pending: 0, running: 0, succeeded: 0 };
|
||||||
|
|
||||||
jobs.forEach(job => {
|
jobs.forEach((job) => {
|
||||||
const pods = this.getChildPods(job);
|
const pods = this.getChildPods(job);
|
||||||
|
|
||||||
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
if (pods.some(pod => pod.getStatus() === PodStatus.FAILED)) {
|
||||||
|
|||||||
@ -23,14 +23,14 @@ export const ContainerEnvironment = observer((props: Props) => {
|
|||||||
useEffect(
|
useEffect(
|
||||||
() =>
|
() =>
|
||||||
autorun(() => {
|
autorun(() => {
|
||||||
env && env.forEach(variable => {
|
env && env.forEach((variable) => {
|
||||||
const { valueFrom } = variable;
|
const { valueFrom } = variable;
|
||||||
|
|
||||||
if (valueFrom && valueFrom.configMapKeyRef) {
|
if (valueFrom && valueFrom.configMapKeyRef) {
|
||||||
configMapsStore.load({ name: valueFrom.configMapKeyRef.name, namespace });
|
configMapsStore.load({ name: valueFrom.configMapKeyRef.name, namespace });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
envFrom && envFrom.forEach(item => {
|
envFrom && envFrom.forEach((item) => {
|
||||||
const { configMapRef } = item;
|
const { configMapRef } = item;
|
||||||
|
|
||||||
if (configMapRef && configMapRef.name) {
|
if (configMapRef && configMapRef.name) {
|
||||||
@ -44,7 +44,7 @@ export const ContainerEnvironment = observer((props: Props) => {
|
|||||||
const renderEnv = () => {
|
const renderEnv = () => {
|
||||||
const orderedEnv = _.sortBy(env, "name");
|
const orderedEnv = _.sortBy(env, "name");
|
||||||
|
|
||||||
return orderedEnv.map(variable => {
|
return orderedEnv.map((variable) => {
|
||||||
const { name, value, valueFrom } = variable;
|
const { name, value, valueFrom } = variable;
|
||||||
let secretValue = null;
|
let secretValue = null;
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ export const ContainerEnvironment = observer((props: Props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderEnvFrom = () => {
|
const renderEnvFrom = () => {
|
||||||
const envVars = envFrom.map(vars => {
|
const envVars = envFrom.map((vars) => {
|
||||||
if (!vars.configMapRef || !vars.configMapRef.name) return;
|
if (!vars.configMapRef || !vars.configMapRef.name) return;
|
||||||
const configMap = configMapsStore.getByName(vars.configMapRef.name, namespace);
|
const configMap = configMapsStore.getByName(vars.configMapRef.name, namespace);
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ export class PodDetailsContainer extends React.Component<Props> {
|
|||||||
{volumeMounts && volumeMounts.length > 0 &&
|
{volumeMounts && volumeMounts.length > 0 &&
|
||||||
<DrawerItem name={<Trans>Mounts</Trans>}>
|
<DrawerItem name={<Trans>Mounts</Trans>}>
|
||||||
{
|
{
|
||||||
volumeMounts.map(mount => {
|
volumeMounts.map((mount) => {
|
||||||
const { name, mountPath, readOnly } = mount;
|
const { name, mountPath, readOnly } = mount;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user