Commit fb0e722e authored by jackgr's avatar jackgr

Fix incorrect expansion validation

parent 94fbdda7
...@@ -17,6 +17,8 @@ limitations under the License. ...@@ -17,6 +17,8 @@ limitations under the License.
package expansion package expansion
import ( import (
"github.com/kubernetes/helm/pkg/chart"
"fmt" "fmt"
) )
...@@ -32,8 +34,13 @@ func ValidateRequest(request *ServiceRequest) error { ...@@ -32,8 +34,13 @@ func ValidateRequest(request *ServiceRequest) error {
chartInv := request.ChartInvocation chartInv := request.ChartInvocation
chartFile := request.Chart.Chartfile chartFile := request.Chart.Chartfile
if chartInv.Type != chartFile.Name { l, err := chart.Parse(chartInv.Type)
return fmt.Errorf("Request chart invocation does not match provided chart") 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 { if chartFile.Expander == nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment