Add support for viewing 'User-supplied values' of helm release (#1862)

Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
osddeitfandSebastian Malton authored and GitHub committed 2021-04-20 11:47:38 -04:00
1 parent a2be178191
commit 04d3cd5b14
6 files changed
+33 -15

No files matched your search

+2 -2
View File
@@ -91,9 +91,9 @@ export class HelmReleaseManager {
return stdout;
}
public async getValues(name: string, namespace: string, pathToKubeconfig: string) {
public async getValues(name: string, namespace: string, all: boolean, pathToKubeconfig: string) {
const helm = await helmCli.binaryPath();
const { stdout, } = await promiseExec(`"${helm}" get values ${name} --all --output yaml --namespace ${namespace} --kubeconfig ${pathToKubeconfig}`).catch((error) => { throw(error.stderr);});
const { stdout, } = await promiseExec(`"${helm}" get values ${name} ${all? "--all": ""} --output yaml --namespace ${namespace} --kubeconfig ${pathToKubeconfig}`).catch((error) => { throw(error.stderr);});
return stdout;
}
+2 -2
View File
@@ -66,12 +66,12 @@ class HelmService {
return await releaseManager.getRelease(releaseName, namespace, cluster);
}
public async getReleaseValues(cluster: Cluster, releaseName: string, namespace: string) {
public async getReleaseValues(cluster: Cluster, releaseName: string, namespace: string, all: boolean) {
const proxyKubeconfig = await cluster.getProxyKubeconfigPath();
logger.debug("Fetch release values");
return await releaseManager.getValues(releaseName, namespace, proxyKubeconfig);
return await releaseManager.getValues(releaseName, namespace, all, proxyKubeconfig);
}
public async getReleaseHistory(cluster: Cluster, releaseName: string, namespace: string) {
+2 -2
View File
@@ -101,10 +101,10 @@ class HelmApiRoute extends LensApi {
}
public async getReleaseValues(request: LensApiRequest) {
const { cluster, params, response } = request;
const { cluster, params, response, query } = request;
try {
const result = await helmService.getReleaseValues(cluster, params.release, params.namespace);
const result = await helmService.getReleaseValues(cluster, params.release, params.namespace, query.has("all"));
this.respondText(response, result);
} catch (error) {