1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix helm releases not updating after rollback

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-02-01 15:23:46 +02:00
parent ec82110dba
commit 2bf4ffbf16
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
3 changed files with 5 additions and 7 deletions

View File

@ -179,13 +179,13 @@ export async function getHistory(name: string, namespace: string, kubeconfigPath
} }
export async function rollback(name: string, namespace: string, revision: number, kubeconfigPath: string) { export async function rollback(name: string, namespace: string, revision: number, kubeconfigPath: string) {
return JSON.parse(await execHelm([ await execHelm([
"rollback", "rollback",
name, name,
`${revision}`, `${revision}`,
"--namespace", namespace, "--namespace", namespace,
"--kubeconfig", kubeconfigPath, "--kubeconfig", kubeconfigPath,
])); ]);
} }
async function getResources(name: string, namespace: string, kubeconfigPath: string, kubectlPath: string) { async function getResources(name: string, namespace: string, kubeconfigPath: string, kubectlPath: string) {

View File

@ -102,9 +102,7 @@ class HelmService {
const proxyKubeconfig = await cluster.getProxyKubeconfigPath(); const proxyKubeconfig = await cluster.getProxyKubeconfigPath();
logger.debug("Rollback release"); logger.debug("Rollback release");
const output = rollback(releaseName, namespace, revision, proxyKubeconfig); await rollback(releaseName, namespace, revision, proxyKubeconfig);
return { message: output };
} }
} }

View File

@ -71,9 +71,9 @@ export class HelmApiRoute {
const { cluster, params, payload, response } = request; const { cluster, params, payload, response } = request;
try { try {
const result = await helmService.rollback(cluster, params.release, params.namespace, payload.revision); await helmService.rollback(cluster, params.release, params.namespace, payload.revision);
respondJson(response, result); response.end();
} catch (error) { } catch (error) {
logger.debug(error); logger.debug(error);
respondText(response, error?.toString() || "Error rolling back chart", 422); respondText(response, error?.toString() || "Error rolling back chart", 422);