Fix incorrect expansion validation

pull/486/head
jackgr 9 years ago
parent 94fbdda7e4
commit fb0e722ed9

@ -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 {
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 {

Loading…
Cancel
Save