Fix chart download issue (#15472)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-08-24 17:05:13 +08:00 committed by GitHub
parent eca3d82d9c
commit 4e998b7dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,9 +169,9 @@ export class HelmChartDefaultService extends HelmChartService {
let chartFileRegexPattern = new RegExp('^http.*/chartrepo/(.*)'); let chartFileRegexPattern = new RegExp('^http.*/chartrepo/(.*)');
if (chartFileRegexPattern.test(filename)) { if (chartFileRegexPattern.test(filename)) {
let match = filename.match('^http.*/chartrepo/(.*)'); let match = filename.match('^http.*/chartrepo/(.*)');
url = `${V1_BASE_HREF + "/chartrepo"}/${match[1]}`; url = `${DOWNLOAD_CHART_ENDPOINT}/${match[1]}`;
} else { } else {
url = `${V1_BASE_HREF + "/chartrepo"}/${projectName}/${filename}`; url = `${DOWNLOAD_CHART_ENDPOINT}/${projectName}/${filename}`;
} }
return this.http.get(url, { return this.http.get(url, {
responseType: 'blob', responseType: 'blob',
@ -209,3 +209,6 @@ export class HelmChartDefaultService extends HelmChartService {
.pipe(catchError(this.handleErrorObservable)); .pipe(catchError(this.handleErrorObservable));
} }
} }
export const DOWNLOAD_CHART_ENDPOINT: string = "/chartrepo";