mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix opening of release details (#5850)
* Make sure release details are updates when opening details Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Relax filtering of resources to prevent crashing when release has installed resources in another namespace Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add Open Closed Principle compliant way to introduce global overrides without modification in getDiForUnitTesting Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Rework helm release details to fix multiple bugs Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove redundant optional chaining Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Simplify code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
e7e8d1688c
commit
bedc440d42
37 files changed
+17798
-566
No files matched your search
@@ -124,6 +124,16 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {})
|
||||
di.preventSideEffects();
|
||||
|
||||
if (doGeneralOverrides) {
|
||||
const globalOverrideFilePaths = getGlobalOverridePaths();
|
||||
|
||||
const globalOverrides = globalOverrideFilePaths.map(
|
||||
(filePath) => require(filePath).default,
|
||||
);
|
||||
|
||||
globalOverrides.forEach(globalOverride => {
|
||||
di.override(globalOverride.injectable, globalOverride.overridingInstantiate);
|
||||
});
|
||||
|
||||
di.override(electronInjectable, () => ({}));
|
||||
di.override(waitUntilBundledExtensionsAreLoadedInjectable, () => async () => {});
|
||||
di.override(getRandomIdInjectable, () => () => "some-irrelevant-random-id");
|
||||
@@ -211,6 +221,14 @@ const getInjectableFilePaths = memoize(() => [
|
||||
...glob.sync("../common/**/*.injectable.{ts,tsx}", { cwd: __dirname }),
|
||||
]);
|
||||
|
||||
const getGlobalOverridePaths = memoize(() =>
|
||||
glob.sync(
|
||||
"../{common,extensions,main}/**/*.global-override-for-injectable.{ts,tsx}",
|
||||
|
||||
{ cwd: __dirname },
|
||||
),
|
||||
);
|
||||
|
||||
// TODO: Reorganize code in Runnables to get rid of requirement for override
|
||||
const overrideRunnablesHavingSideEffects = (di: DiContainer) => {
|
||||
[
|
||||
|
||||
@@ -191,7 +191,6 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str
|
||||
];
|
||||
const kubectlArgs = [
|
||||
"get",
|
||||
"--namespace", namespace,
|
||||
"--kubeconfig", kubeconfigPath,
|
||||
"-f", "-",
|
||||
"--output", "json",
|
||||
|
||||
Reference in new issue
Block a user