Skip to content

Commit

Permalink
fixing version checks for charts with '-' in their names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Alajrami committed Mar 3, 2018
1 parent 5d94346 commit 1da063c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helm_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ func getReleaseChartName(releaseName string) string {
// getReleaseChartVersion extracts and returns the Helm chart version from the chart info retrieved by getReleaseChart().
// example: getReleaseChart() returns "jenkins-0.9.0" and this functions will extract "0.9.0" from it.
func getReleaseChartVersion(releaseName string) string {
return strings.TrimSpace(strings.Split(getReleaseChart(releaseName), "-")[1])
chart := getReleaseChart(releaseName)
runes := []rune(chart)
return string(runes[strings.LastIndexByte(chart, '-')+1 : len(chart)])
}

// getReleaseStatus returns the output of Helm status command for a release.
Expand Down

0 comments on commit 1da063c

Please sign in to comment.