respect prerelease preference when auto-selecting helm chart version; retain version query param when cancelling chart install (#8514)

This commit is contained in:
Nancy 2023-03-27 12:47:23 -07:00 committed by GitHub
parent 95c1be127c
commit b059eaa6de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -292,7 +292,13 @@ export default {
// use the first version provided by the Helm chart
// as the default.
if ( !this.query.versionName && this.chart.versions?.length ) {
this.query.versionName = this.chart.versions[0].version;
if (this.showPreRelease) {
this.query.versionName = this.chart.versions[0].version;
} else {
const firstRelease = this.chart.versions.find(v => !isPrerelease(v.version));
this.query.versionName = firstRelease?.version || this.chart.versions[0].version;
}
}
if ( !this.query.versionName ) {
@ -426,7 +432,7 @@ export default {
repoType: this.chart.repoType,
repoName: this.chart.repoName,
name: this.chart.chartName,
version: this.chart.versionName,
version: this.query.versionName,
};
return {