|
|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
|
|
"k8s.io/helm/pkg/proto/hapi/chart"
|
|
|
|
|
"k8s.io/helm/pkg/version"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestLoadRequirements(t *testing.T) {
|
|
|
|
@ -347,11 +348,24 @@ func TestGetAliasDependency(t *testing.T) {
|
|
|
|
|
t.Fatalf("Dependency chart name should be %s but got %s", req.Dependencies[0].Name, aliasChart.Metadata.Name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if req.Dependencies[0].Version != "" {
|
|
|
|
|
if !version.IsCompatibleRange(req.Dependencies[0].Version, aliasChart.Metadata.Version) {
|
|
|
|
|
t.Fatalf("Dependency chart version is not in the compatible range")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Failure case
|
|
|
|
|
req.Dependencies[0].Name = "something-else"
|
|
|
|
|
if aliasChart := getAliasDependency(c.Dependencies, req.Dependencies[0]); aliasChart != nil {
|
|
|
|
|
t.Fatalf("expected no chart but got %s", aliasChart.Metadata.Name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
req.Dependencies[0].Version = "something else which is not in the compatible range"
|
|
|
|
|
if version.IsCompatibleRange(req.Dependencies[0].Version, aliasChart.Metadata.Version) {
|
|
|
|
|
t.Fatalf("Dependency chart version which is not in the compatible range should cause a failure other than a success ")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestDependentChartAliases(t *testing.T) {
|
|
|
|
|