Fix bugs in helm releases (#4785)

* Fix opening of upgrade release tab

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Bring back ability to rollback to specific revision

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

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* 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>

* Fix helm releases not updating after upgrade

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

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala authored and GitHub committed 2022-02-01 16:18:43 +02:00
1 parent c1d557aeee
commit e8205a64b9
5 files changed
+29 -11

No files matched your search

+3 -2
View File
@@ -179,12 +179,13 @@ export async function getHistory(name: string, namespace: string, kubeconfigPath
}
export async function rollback(name: string, namespace: string, revision: number, kubeconfigPath: string) {
return JSON.parse(await execHelm([
await execHelm([
"rollback",
name,
`${revision}`,
"--namespace", namespace,
"--kubeconfig", kubeconfigPath,
]));
]);
}
async function getResources(name: string, namespace: string, kubeconfigPath: string, kubectlPath: string) {
+1 -3
View File
@@ -102,9 +102,7 @@ class HelmService {
const proxyKubeconfig = await cluster.getProxyKubeconfigPath();
logger.debug("Rollback release");
const output = rollback(releaseName, namespace, revision, proxyKubeconfig);
return { message: output };
await rollback(releaseName, namespace, revision, proxyKubeconfig);
}
}
+2 -2
View File
@@ -71,9 +71,9 @@ export class HelmApiRoute {
const { cluster, params, payload, response } = request;
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) {
logger.debug(error);
respondText(response, error?.toString() || "Error rolling back chart", 422);