From fb0e722ed953cca51d5695f8fc34f48e8a86fcc4 Mon Sep 17 00:00:00 2001 From: jackgr Date: Tue, 29 Mar 2016 13:56:24 -0700 Subject: [PATCH] Fix incorrect expansion validation --- pkg/expansion/validate.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/expansion/validate.go b/pkg/expansion/validate.go index 02f97c0d9..a012df194 100644 --- a/pkg/expansion/validate.go +++ b/pkg/expansion/validate.go @@ -17,6 +17,8 @@ limitations under the License. package expansion import ( + "github.com/kubernetes/helm/pkg/chart" + "fmt" ) @@ -32,8 +34,13 @@ func ValidateRequest(request *ServiceRequest) error { chartInv := request.ChartInvocation chartFile := request.Chart.Chartfile - if chartInv.Type != chartFile.Name { - return fmt.Errorf("Request chart invocation does not match provided chart") + l, err := chart.Parse(chartInv.Type) + if err != nil { + return fmt.Errorf("cannot parse chart reference %s: %s", chartInv.Type, err) + } + + if l.Name != chartFile.Name { + return fmt.Errorf("Chart invocation type (%s) does not match provided chart (%s)", chartInv.Type, chartFile.Name) } if chartFile.Expander == nil {