diff --git a/package.json b/package.json
index ffa8c1484c..f2d82f0731 100644
--- a/package.json
+++ b/package.json
@@ -286,7 +286,7 @@
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.6",
- "@types/react-select": "^4.0.13",
+ "@types/react-select": "^3.0.13",
"@types/react-window": "^1.8.2",
"@types/readable-stream": "^2.3.9",
"@types/request": "^2.48.5",
@@ -350,7 +350,7 @@
"react-beautiful-dnd": "^13.0.0",
"react-refresh": "^0.9.0",
"react-router-dom": "^5.2.0",
- "react-select": "^4.3.0",
+ "react-select": "^3.1.0",
"react-select-event": "^5.1.0",
"react-window": "^1.8.5",
"sass-loader": "^8.0.2",
diff --git a/src/main/cluster.ts b/src/main/cluster.ts
index dd0dc618db..2be7bde435 100644
--- a/src/main/cluster.ts
+++ b/src/main/cluster.ts
@@ -511,7 +511,8 @@ export class Cluster implements ClusterModel, ClusterState {
timeout: 0,
resolveWithFullResponse: false,
json: true,
- qs: queryParams,
+ method: "POST",
+ form: queryParams,
});
}
diff --git a/src/main/node-shell-session.ts b/src/main/node-shell-session.ts
index 0799f9f892..c20567363e 100644
--- a/src/main/node-shell-session.ts
+++ b/src/main/node-shell-session.ts
@@ -26,7 +26,7 @@ export class NodeShellSession extends ShellSession {
if (this.createNodeShellPod(this.podId, this.nodeName)) {
await this.waitForRunningPod(this.podId).catch(() => {
- this.exit(1001);
+ this.exitAndClean(1001);
});
}
args = ["exec", "-i", "-t", "-n", "kube-system", this.podId, "--", "sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))"];
@@ -49,11 +49,14 @@ export class NodeShellSession extends ShellSession {
appEventBus.emit({name: "node-shell", action: "open"});
}
- protected exit(code = 1000) {
+ protected exitAndClean(code = 1000) {
if (this.podId) {
this.deleteNodeShellPod();
}
- super.exit(code);
+
+ if (code != 1000) {
+ this.sendResponse("Error occurred. ");
+ }
}
protected async createNodeShellPod(podId: string, nodeName: string) {
@@ -65,6 +68,7 @@ export class NodeShellSession extends ShellSession {
namespace: "kube-system"
},
spec: {
+ nodeName,
restartPolicy: "Never",
terminationGracePeriodSeconds: 0,
hostPID: true,
@@ -82,9 +86,6 @@ export class NodeShellSession extends ShellSession {
command: ["nsenter"],
args: ["-t", "1", "-m", "-u", "-i", "-n", "sleep", "14000"]
}],
- nodeSelector: {
- "kubernetes.io/hostname": nodeName
- }
}
} as k8s.V1Pod;
diff --git a/src/renderer/bootstrap.tsx b/src/renderer/bootstrap.tsx
index ce42e56f3c..c9ef607871 100644
--- a/src/renderer/bootstrap.tsx
+++ b/src/renderer/bootstrap.tsx
@@ -19,7 +19,6 @@ import { filesystemProvisionerStore } from "../main/extension-filesystem";
import { App } from "./components/app";
import { LensApp } from "./lens-app";
import { themeStore } from "./theme.store";
-import { NonceProvider as StyleCache } from "react-select";
/**
* If this is a development buid, wait a second to attach
@@ -79,14 +78,9 @@ export async function bootstrap(App: AppComponent) {
window.location.href = "about:blank";
}
});
-
- const cacheProps = { nonce: "lens", cacheKey: "lens" };
-
render(<>
{isMac &&
}
-
-
-
+
>, rootElem);
}
diff --git a/src/renderer/components/+cluster/cluster-issues.tsx b/src/renderer/components/+cluster/cluster-issues.tsx
index 0aabebaa27..913c78167c 100644
--- a/src/renderer/components/+cluster/cluster-issues.tsx
+++ b/src/renderer/components/+cluster/cluster-issues.tsx
@@ -134,6 +134,7 @@ export class ClusterIssues extends React.Component {
<>Warnings: {warnings.length}>
) => {
+const Placeholder = observer((props: PlaceholderProps) => {
const getPlaceholder = (): React.ReactNode => {
const namespaces = namespaceStore.contextNamespaces;
@@ -71,7 +71,6 @@ export class NamespaceSelectFilter extends React.Component {
placeholder={""}
onChange={this.onChange}
formatOptionLabel={this.formatOptionLabel}
- className="NamespaceSelectFilter"
/>
);
}
diff --git a/src/renderer/components/+namespaces/namespace-select.scss b/src/renderer/components/+namespaces/namespace-select.scss
index f300544cfb..33293a6d7a 100644
--- a/src/renderer/components/+namespaces/namespace-select.scss
+++ b/src/renderer/components/+namespaces/namespace-select.scss
@@ -23,6 +23,22 @@
.NamespaceSelect {
@include namespaceSelectCommon;
+
+ .Select {
+ &__placeholder {
+ width: 100%;
+ white-space: nowrap;
+ overflow: scroll;
+ margin-left: -8px;
+ padding-left: 8px;
+ margin-right: -8px;
+ padding-right: 8px;
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
+ }
+ }
}
.NamespaceSelectMenu {
diff --git a/src/renderer/components/+namespaces/namespace-select.tsx b/src/renderer/components/+namespaces/namespace-select.tsx
index d3df621b50..d398f91f0a 100644
--- a/src/renderer/components/+namespaces/namespace-select.tsx
+++ b/src/renderer/components/+namespaces/namespace-select.tsx
@@ -1,4 +1,4 @@
-import "./namespace-select-filter.scss";
+import "./namespace-select.scss";
import React from "react";
import { computed } from "mobx";
@@ -8,6 +8,7 @@ import { cssNames } from "../../utils";
import { Icon } from "../icon";
import { namespaceStore } from "./namespace.store";
import { kubeWatchApi } from "../../api/kube-watch-api";
+import { components, ValueContainerProps } from "react-select";
interface Props extends SelectProps {
showIcons?: boolean;
@@ -21,6 +22,16 @@ const defaultProps: Partial = {
showClusterOption: false,
};
+function GradientValueContainer({children, ...rest}: ValueContainerProps) {
+ return (
+
+
+ {children}
+
+
+ );
+}
+
@observer
export class NamespaceSelect extends React.Component {
static defaultProps = defaultProps as object;
@@ -66,6 +77,8 @@ export class NamespaceSelect extends React.Component {
render() {
const { className, showIcons, customizeOptions, components = {}, ...selectProps } = this.props;
+ components.ValueContainer ??= GradientValueContainer;
+
return (