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:
parent
ec82110dba
commit
2bf4ffbf16
@ -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) {
|
||||||
|
|||||||
@ -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 };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user