Skip to content

Commit

Permalink
Merge branch 'daplho-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Alajrami committed May 6, 2018
2 parents 24f8a41 + d4cbb68 commit c479ecd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions helm_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func getTillerReleases(tillerNS string) string {
// appending tiller-namespace to each release found
lines := strings.Split(result, "\n")
for i, l := range lines {
if l != "" && !strings.HasPrefix(l, "NAME") && !strings.HasSuffix(l, "NAMESPACE") {
if l != "" && !strings.HasPrefix(strings.TrimSpace(l), "NAME") && !strings.HasSuffix(strings.TrimSpace(l), "NAMESPACE") {
lines[i] = strings.TrimSuffix(l, "\n") + " " + tillerNS
}
}
Expand All @@ -61,7 +61,7 @@ func buildState() {
lines := strings.Split(getAllReleases(), "\n")

for i := 0; i < len(lines); i++ {
if lines[i] == "" || (strings.HasPrefix(lines[i], "NAME") && strings.HasSuffix(lines[i], "NAMESPACE")) {
if lines[i] == "" || (strings.HasPrefix(strings.TrimSpace(lines[i]), "NAME") && strings.HasSuffix(strings.TrimSpace(lines[i]), "NAMESPACE")) {
continue
}
r, _ := strconv.Atoi(strings.Fields(lines[i])[1])
Expand Down Expand Up @@ -192,7 +192,7 @@ func getReleaseRevision(releaseName string, state string) string {
func getReleaseChartName(releaseName string) string {
chart := getReleaseChart(releaseName)
runes := []rune(chart)
return string(runes[0:strings.LastIndexByte(chart, '-')])
return string(runes[0:strings.LastIndexByte(chart[0:strings.IndexByte(chart, '.')], '-')])
}

// getReleaseChartVersion extracts and returns the Helm chart version from the chart info retrieved by getReleaseChart().
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var verbose bool
var nsOverride string
var checkCleanup bool
var skipValidation bool
var version = "v1.2.0-rc1"
var version = "v1.2.0-rc2"

func main() {

Expand Down

0 comments on commit c479ecd

Please sign in to comment.