mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve Helm release version detection
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
a36a279bce
commit
54cf862244
1 file changed
+7
-4
@@ -156,9 +156,12 @@ export class HelmRelease implements ItemObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getChart(withVersion = false) {
|
getChart(withVersion = false) {
|
||||||
return withVersion ?
|
let chart = this.chart
|
||||||
this.chart :
|
if(!withVersion && this.getVersion() != "" ) {
|
||||||
this.chart.substr(0, this.chart.lastIndexOf("-"));
|
const search = new RegExp(`-${this.getVersion()}`)
|
||||||
|
chart = chart.replace(search, "");
|
||||||
|
}
|
||||||
|
return chart
|
||||||
}
|
}
|
||||||
|
|
||||||
getRevision() {
|
getRevision() {
|
||||||
@@ -170,7 +173,7 @@ export class HelmRelease implements ItemObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getVersion() {
|
getVersion() {
|
||||||
const versions = this.chart.match(/(\d+)[^-]*$/)
|
const versions = this.chart.match(/(v?\d+)[^-].*$/)
|
||||||
if (versions) {
|
if (versions) {
|
||||||
return versions[0]
|
return versions[0]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user