mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Release/v6.0.2 alpha.0 (#6116)
* Fix create release PR to cherry-pick commits Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix create release PR to cherry-pick commits Signed-off-by: Sebastian Malton <sebastian@malton.name> * release v6.0.2-alpha.0 Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix Badges being too small when scrollable and not expandable (#5987) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Remove Tabs hover line width transition (#6020) Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix distribution detector erroneously depending on previous metadata (#6023) Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> * Override @astronautlabs/jsonpath's underscore version (#6044) * Override @astronautlabs/jsonpath's underscore version Signed-off-by: Sebastian Malton <sebastian@malton.name> * Remove use of buggy 'yarn check' Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> * Don't error out if we can't find resources from helm in our cluster, and handle "blank" output from kubectl gracefully. (#6039) * Use official node-fetch 2.x (#6049) * Fix UI for scaling ReplicaSets (#6052) * Use color-scheme: auto on all iframes (#6074) Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Use abort-controller package to fix typing issues (#6077) * Use default export to fix issue with package lying with types (#6081) Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> * Switch ubuntu CI to ubuntu-20.04 (#6078) Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix <Select/> text overflow below baseline (#6085) * Fix: do not crop <Select/> single value Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix: do not crop namespace selector placeholder Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Align working dir input height with others Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fix Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Prevent massed remounting of dock tabs when dock height changes (#6104) * Update injectable to make withInjectables have authentic React reconciliation Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make some dock tabs have primitive props to have them React reconcile properly Currently tab objects that are stored in a storage change reference on every change of dock height, making them less usable as React prop for causing involuntary remounting. Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Fix node conditions column text-align (#6092) Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Make cluster #app component transparent (#6076) until theme ready Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix badge not expanding on click when appropriate (#6029) * Fix badge not expanding on click when appropriate Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix snapshots Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix snapshots Signed-off-by: Sebastian Malton <sebastian@malton.name> * Update other snapshots Signed-off-by: Sebastian Malton <sebastian@malton.name> * Remove unneccessary code Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> * Disable fail-fast on the testing CI jobs (#6080) - There are several reasons why these might fail that are irrelavent to the other pipelines. So we should just let them continue Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com> Co-authored-by: Michael Pearson <mipearson@gmail.com> Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Co-authored-by: Carlos René Mederos Arias <krlosmederos@gmail.com> Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
28 files changed
+303
-203
No files matched your search
@@ -6,7 +6,6 @@
|
||||
import { forRemoteCluster, KubeApi } from "../kube-api";
|
||||
import { KubeJsonApi } from "../kube-json-api";
|
||||
import { KubeObject } from "../kube-object";
|
||||
import AbortController from "abort-controller";
|
||||
import { delay } from "../../utils/delay";
|
||||
import { PassThrough } from "stream";
|
||||
import { ApiManager } from "../api-manager";
|
||||
@@ -15,6 +14,7 @@ import { DeploymentApi, Ingress, IngressApi, Pod, PodApi } from "../endpoints";
|
||||
import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting";
|
||||
import apiManagerInjectable from "../api-manager/manager.injectable";
|
||||
import autoRegistrationInjectable from "../api-manager/auto-registration.injectable";
|
||||
import AbortController from "abort-controller";
|
||||
|
||||
jest.mock("../api-manager");
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import { KubeJsonApi } from "./kube-json-api";
|
||||
import type { Disposer } from "../utils";
|
||||
import { isDefined, noop, WrappedAbortController } from "../utils";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
import type AbortController from "abort-controller";
|
||||
import type { AgentOptions } from "https";
|
||||
import { Agent } from "https";
|
||||
import type { Patch } from "rfc6902";
|
||||
@@ -28,6 +27,7 @@ import type { PartialDeep } from "type-fest";
|
||||
import logger from "../logger";
|
||||
import { Environments, getEnvironmentSpecificLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||
import autoRegistrationEmitterInjectable from "./api-manager/auto-registration-emitter.injectable";
|
||||
import type AbortController from "abort-controller";
|
||||
|
||||
/**
|
||||
* The options used for creating a `KubeApi`
|
||||
|
||||
@@ -15,12 +15,12 @@ import { ItemStore } from "../item.store";
|
||||
import type { KubeApiQueryParams, KubeApi, KubeApiWatchCallback } from "./kube-api";
|
||||
import { parseKubeApi } from "./kube-api-parse";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
import AbortController from "abort-controller";
|
||||
import type { Patch } from "rfc6902";
|
||||
import logger from "../logger";
|
||||
import assert from "assert";
|
||||
import type { PartialDeep } from "type-fest";
|
||||
import { entries } from "../utils/objects";
|
||||
import AbortController from "abort-controller";
|
||||
|
||||
export type OnLoadFailure = (error: unknown) => void;
|
||||
|
||||
@@ -477,7 +477,8 @@ export abstract class KubeObjectStore<
|
||||
callback,
|
||||
});
|
||||
|
||||
const { signal } = abortController;
|
||||
// TODO: upgrade node-fetch once we are starting to use ES modules
|
||||
const signal = abortController.signal;
|
||||
|
||||
const callback: KubeApiWatchCallback<D> = (data, error) => {
|
||||
if (!this.isLoaded || error?.type === "aborted") return;
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import AbortController from "abort-controller";
|
||||
|
||||
/**
|
||||
* This is like an `AbortController` but will also abort if the parent aborts,
|
||||
* but won't make the parent abort if this aborts (single direction)
|
||||
*/
|
||||
export class WrappedAbortController extends AbortController {
|
||||
constructor(parent?: AbortController) {
|
||||
super();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { AbortController } from "abort-controller";
|
||||
import type AbortController from "abort-controller";
|
||||
|
||||
/**
|
||||
* Return a promise that will be resolved after at least `timeout` ms have
|
||||
|
||||
@@ -96,8 +96,6 @@ export class DistributionDetector extends BaseClusterDetector {
|
||||
}
|
||||
|
||||
public async getKubernetesVersion() {
|
||||
if (this.cluster.version) return this.cluster.version;
|
||||
|
||||
const response = await this.k8sRequest("/version");
|
||||
|
||||
return response.gitVersion;
|
||||
|
||||
@@ -194,6 +194,11 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str
|
||||
"--kubeconfig", kubeconfigPath,
|
||||
"-f", "-",
|
||||
"--output", "json",
|
||||
// Temporary workaround for https://github.com/lensapp/lens/issues/6031
|
||||
// and other potential issues where resources can't be found. Showing
|
||||
// no resources is better than the app hard-locking, and at least
|
||||
// the helm metadata is shown.
|
||||
"--ignore-not-found",
|
||||
];
|
||||
|
||||
try {
|
||||
@@ -208,9 +213,13 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str
|
||||
.on("exit", (code, signal) => {
|
||||
if (typeof code === "number") {
|
||||
if (code === 0) {
|
||||
const output = json.parse(stdout) as { items: JsonObject[] };
|
||||
if (stdout === "") {
|
||||
resolve([]);
|
||||
} else {
|
||||
const output = json.parse(stdout) as { items: JsonObject[] };
|
||||
|
||||
resolve(output.items);
|
||||
resolve(output.items);
|
||||
}
|
||||
} else {
|
||||
reject(stderr);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
padding-left: 8px;
|
||||
margin-right: -8px;
|
||||
padding-right: 8px;
|
||||
line-height: 1.1;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
|
||||
&.conditions {
|
||||
flex: 1.7;
|
||||
text-align: right;
|
||||
|
||||
.condition {
|
||||
display: inline-block;
|
||||
|
||||
@@ -104,7 +104,7 @@ class NonInjectedReplicaSetScaleDialog extends Component<ReplicaSetScaleDialogPr
|
||||
<Wizard
|
||||
header={(
|
||||
<h5>
|
||||
Scale Replica Set
|
||||
{"Scale Replica Set "}
|
||||
<span>{replicaSet.getName()}</span>
|
||||
</h5>
|
||||
)}
|
||||
@@ -131,16 +131,16 @@ class NonInjectedReplicaSetScaleDialog extends Component<ReplicaSetScaleDialogPr
|
||||
/>
|
||||
</div>
|
||||
<div className="plus-minus-container flex gaps">
|
||||
<Icon
|
||||
material="add_circle_outline"
|
||||
onClick={this.desiredReplicasUp}
|
||||
data-testid="desired-replicas-up"
|
||||
/>
|
||||
<Icon
|
||||
material="remove_circle_outline"
|
||||
onClick={this.desiredReplicasDown}
|
||||
data-testid="desired-replicas-down"
|
||||
/>
|
||||
<Icon
|
||||
material="add_circle_outline"
|
||||
onClick={this.desiredReplicasUp}
|
||||
data-testid="desired-replicas-up"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{warning && (
|
||||
|
||||
@@ -72,7 +72,6 @@ html, body {
|
||||
|
||||
body {
|
||||
color: var(--textColorPrimary);
|
||||
background-color: var(--mainBackground);
|
||||
font-size: var(--font-size);
|
||||
font-family: var(--font-main);
|
||||
}
|
||||
@@ -89,6 +88,11 @@ body {
|
||||
#app {
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
background-color: var(--mainBackground);
|
||||
|
||||
&:empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
> * {
|
||||
height: inherit;
|
||||
@@ -180,6 +184,10 @@ a {
|
||||
}
|
||||
}
|
||||
|
||||
iframe {
|
||||
color-scheme: auto; // Remove default white background on iframes
|
||||
}
|
||||
|
||||
// colors
|
||||
.success {
|
||||
color: var(--colorSuccess);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.badge:not(.isExpanded) {
|
||||
.badge:not(.scrollable):not(.isExpanded) {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import styles from "./badge.module.scss";
|
||||
|
||||
import React, { createRef, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { action, observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { cssNames } from "../../utils/cssNames";
|
||||
@@ -40,12 +40,15 @@ export const Badge = withTooltip(observer(({
|
||||
children,
|
||||
...elemProps
|
||||
}: BadgeProps) => {
|
||||
const elem = createRef<HTMLDivElement>();
|
||||
const elem = useRef<HTMLDivElement>(null);
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const [isExpandable, setIsExpandable] = useState(false);
|
||||
|
||||
const isExpandable = expandable && elem.current
|
||||
? elem.current.clientWidth < elem.current.scrollWidth
|
||||
: false;
|
||||
useEffect(() => {
|
||||
const { clientWidth = 0, scrollWidth = 0 } = elem.current ?? {};
|
||||
|
||||
setIsExpandable(expandable && (clientWidth < scrollWidth));
|
||||
}, [expandable, elem.current]);
|
||||
|
||||
const onMouseUp = action(() => {
|
||||
if (!isExpandable || badgeMeta.hasTextSelected) {
|
||||
|
||||
+3
@@ -166,6 +166,8 @@ export const ClusterLocalTerminalSetting = observer(({ cluster }: ClusterLocalTe
|
||||
material="close"
|
||||
title="Clear"
|
||||
onClick={() => setAndCommitDirectory("")}
|
||||
smallest
|
||||
style={{ marginRight: "var(--margin)" }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -173,6 +175,7 @@ export const ClusterLocalTerminalSetting = observer(({ cluster }: ClusterLocalTe
|
||||
material="folder"
|
||||
title="Pick from filesystem"
|
||||
onClick={openFilePicker}
|
||||
smallest
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -11,7 +11,6 @@ import type { IComputedValue } from "mobx";
|
||||
import { makeObservable, observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import type { CreateResourceTabStore } from "./store";
|
||||
import type { DockTab } from "../dock/store";
|
||||
import { EditorPanel } from "../editor-panel";
|
||||
import { InfoPanel } from "../info-panel";
|
||||
import * as resourceApplierApi from "../../../../common/k8s-api/endpoints/resource-applier.api";
|
||||
@@ -31,7 +30,7 @@ import getDetailsUrlInjectable from "../../kube-detail-params/get-details-url.in
|
||||
import navigateInjectable from "../../../navigation/navigate.injectable";
|
||||
|
||||
export interface CreateResourceProps {
|
||||
tab: DockTab;
|
||||
tabId: string;
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
@@ -52,7 +51,7 @@ class NonInjectedCreateResource extends React.Component<CreateResourceProps & De
|
||||
}
|
||||
|
||||
get tabId() {
|
||||
return this.props.tab.id;
|
||||
return this.props.tabId;
|
||||
}
|
||||
|
||||
get data() {
|
||||
|
||||
@@ -104,11 +104,11 @@ class NonInjectedDock extends React.Component<DockProps & Dependencies> {
|
||||
renderTab(tab: DockTab) {
|
||||
switch (tab.kind) {
|
||||
case TabKind.CREATE_RESOURCE:
|
||||
return <CreateResource tab={tab} />;
|
||||
return <CreateResource tabId={tab.id} />;
|
||||
case TabKind.EDIT_RESOURCE:
|
||||
return <EditResource tab={tab} />;
|
||||
return <EditResource tabId={tab.id} />;
|
||||
case TabKind.INSTALL_CHART:
|
||||
return <InstallChart tab={tab} />;
|
||||
return <InstallChart tabId={tab.id} />;
|
||||
case TabKind.UPGRADE_CHART:
|
||||
return <UpgradeChart tab={tab} />;
|
||||
case TabKind.POD_LOGS:
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import type { DockTab } from "../dock/store";
|
||||
import { Spinner } from "../../spinner";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { EditResourceModel } from "./edit-resource-model/edit-resource-model.injectable";
|
||||
@@ -16,7 +15,7 @@ import { Badge } from "../../badge";
|
||||
import { Notice } from "../../+extensions/notice";
|
||||
|
||||
export interface EditResourceProps {
|
||||
tab: DockTab;
|
||||
tabId: string;
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
@@ -24,7 +23,7 @@ interface Dependencies {
|
||||
}
|
||||
|
||||
const NonInjectedEditResource = observer(
|
||||
({ model, tab: { id: tabId }}: EditResourceProps & Dependencies) => {
|
||||
({ model, tabId }: EditResourceProps & Dependencies) => {
|
||||
return (
|
||||
<div className="EditResource flex column">
|
||||
{model.shouldShowErrorAboutNoResource && (
|
||||
@@ -78,7 +77,7 @@ export const EditResource = withInjectables<Dependencies, EditResourceProps>(
|
||||
),
|
||||
|
||||
getProps: async (di, props) => ({
|
||||
model: await di.inject(editResourceModelInjectable, props.tab.id),
|
||||
model: await di.inject(editResourceModelInjectable, props.tabId),
|
||||
...props,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -7,7 +7,6 @@ import "./install-chart.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import type { DockTab } from "../dock/store";
|
||||
import { InfoPanel } from "../info-panel";
|
||||
import { Badge } from "../../badge";
|
||||
import { NamespaceSelect } from "../../+namespaces/namespace-select";
|
||||
@@ -23,8 +22,8 @@ import type { InstallChartModel } from "./install-chart-model.injectable";
|
||||
import installChartModelInjectable from "./install-chart-model.injectable";
|
||||
import { Spinner } from "../../spinner";
|
||||
|
||||
export interface InstallCharProps {
|
||||
tab: DockTab;
|
||||
export interface InstallChartProps {
|
||||
tabId: string;
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
@@ -32,7 +31,7 @@ interface Dependencies {
|
||||
}
|
||||
|
||||
const NonInjectedInstallChart = observer(
|
||||
({ model: model, tab: { id: tabId }}: InstallCharProps & Dependencies) => {
|
||||
({ model: model, tabId }: InstallChartProps & Dependencies) => {
|
||||
const installed = model.installed.get();
|
||||
|
||||
if (installed) {
|
||||
@@ -144,7 +143,7 @@ const NonInjectedInstallChart = observer(
|
||||
},
|
||||
);
|
||||
|
||||
export const InstallChart = withInjectables<Dependencies, InstallCharProps>(
|
||||
export const InstallChart = withInjectables<Dependencies, InstallChartProps>(
|
||||
NonInjectedInstallChart,
|
||||
|
||||
{
|
||||
@@ -156,7 +155,7 @@ export const InstallChart = withInjectables<Dependencies, InstallCharProps>(
|
||||
),
|
||||
|
||||
getProps: async (di, props) => ({
|
||||
model: await di.inject(installChartModelInjectable, props.tab.id),
|
||||
model: await di.inject(installChartModelInjectable, props.tabId),
|
||||
...props,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -49,6 +49,7 @@ html {
|
||||
|
||||
&__single-value {
|
||||
color: var(--textColorSecondary);
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
&__indicator {
|
||||
|
||||
@@ -54,11 +54,10 @@
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 0;
|
||||
height: $unit * 0.5;
|
||||
transition: width 150ms;
|
||||
height: 3px;
|
||||
transition: opacity 150ms;
|
||||
background: currentColor;
|
||||
color: var(--halfGray)
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
@@ -76,6 +75,7 @@
|
||||
left: 0;
|
||||
right: auto;
|
||||
color: var(--line-color-active);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
import { comparer, reaction } from "mobx";
|
||||
import type { Disposer } from "../../common/utils";
|
||||
import { disposer, getOrInsert, noop, WrappedAbortController } from "../../common/utils";
|
||||
import AbortController from "abort-controller";
|
||||
import { once } from "lodash";
|
||||
import type { ClusterFrameContext } from "../cluster-frame-context/cluster-frame-context";
|
||||
import logger from "../../common/logger";
|
||||
import type { KubeObjectStoreLoadAllParams, KubeObjectStoreSubscribeParams } from "../../common/k8s-api/kube-object.store";
|
||||
import AbortController from "abort-controller";
|
||||
|
||||
// Kubernetes watch-api client
|
||||
// API: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams
|
||||
|
||||
Reference in new issue
Block a user