From b059eaa6de43bb78142417b3dc70f87cd5f3423c Mon Sep 17 00:00:00 2001 From: Nancy <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:47:23 -0700 Subject: [PATCH] respect prerelease preference when auto-selecting helm chart version; retain version query param when cancelling chart install (#8514) --- shell/mixins/chart.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell/mixins/chart.js b/shell/mixins/chart.js index bce6b055dd..b15193aa26 100644 --- a/shell/mixins/chart.js +++ b/shell/mixins/chart.js @@ -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 {