mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Introduce way for execute file Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make typing of HelmRepo shared Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce way to get Helm environment values Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce function to read YAML file Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce competition for listing active helm repositories in preferences Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make sense in name of injectable Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce helper for opening and selecting values of select Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce competition for activating, deactivating public helm repositories in preferences Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce competition for deactivating helm repository from list of active repositories Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add missing global overrides Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make some tests more deterministic by mocking tooltips Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce competition for activating custom helm repository in preferences Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Update snapshots Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove old implementation made redundant with competition for preferences of helm repositories Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add success notification for activating custom helm repository Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce way to get single active helm repository Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Extract responsibilities from god-class and switch to getting helm repositories using competition instead of another god class Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove dead code Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add TODO Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Tweak position of spinner Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Start handling errors when accessing helm repositories Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Handle error about no helm repositories when updating repositories Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove unwarranted function configuration Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add missing global overrides Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove duplication how to acquire binary path for helm Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove redundant comment Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Consolidate naming to match Helm's internal Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Relocate file closer to it's relatives Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
154 lines
3.2 KiB
TypeScript
154 lines
3.2 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import { sortCharts } from "../../../common/utils";
|
|
import type { HelmRepo } from "../../../common/helm/helm-repo";
|
|
|
|
const charts = new Map([
|
|
["stable", {
|
|
"invalid-semver": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "weird-versioning",
|
|
version: "I am not semver",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "weird-versioning",
|
|
version: "v4.3.0",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "weird-versioning",
|
|
version: "I am not semver but more",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "weird-versioning",
|
|
version: "v4.4.0",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
]),
|
|
"apm-server": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "apm-server",
|
|
version: "2.1.7",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "apm-server",
|
|
version: "2.1.6",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
]),
|
|
"redis": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "apm-server",
|
|
version: "1.0.0",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "apm-server",
|
|
version: "0.0.9",
|
|
repo: "stable",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
]),
|
|
}],
|
|
["experiment", {
|
|
"fairwind": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "fairwind",
|
|
version: "0.0.1",
|
|
repo: "experiment",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "fairwind",
|
|
version: "0.0.2",
|
|
repo: "experiment",
|
|
digest: "test",
|
|
deprecated: true,
|
|
created: "now",
|
|
},
|
|
]),
|
|
}],
|
|
["bitnami", {
|
|
"hotdog": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "hotdog",
|
|
version: "1.0.1",
|
|
repo: "bitnami",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "hotdog",
|
|
version: "1.0.2",
|
|
repo: "bitnami",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
]),
|
|
"pretzel": sortCharts([
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "pretzel",
|
|
version: "1.0",
|
|
repo: "bitnami",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
{
|
|
apiVersion: "3.0.0",
|
|
name: "pretzel",
|
|
version: "1.0.1",
|
|
repo: "bitnami",
|
|
digest: "test",
|
|
created: "now",
|
|
},
|
|
]),
|
|
}],
|
|
]);
|
|
|
|
export class HelmChartManager {
|
|
constructor(private repo: HelmRepo){ }
|
|
|
|
static forRepo(repo: HelmRepo) {
|
|
return new this(repo);
|
|
}
|
|
|
|
public async charts(): Promise<any> {
|
|
return charts.get(this.repo.name) ?? {};
|
|
}
|
|
}
|