|
|
|
|
@ -85,7 +85,7 @@ func TestIndexCustomSchemeDownload(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(myCustomGetter.repoUrls) != 1 {
|
|
|
|
|
t.Fatalf("Custom Getter.Get should be called once")
|
|
|
|
|
t.Fatal("Custom Getter.Get should be called once")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expectedRepoIndexURL := repoURL + "/index.yaml"
|
|
|
|
|
@ -240,7 +240,7 @@ func TestErrorFindChartInRepoURL(t *testing.T) {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if _, err := FindChartInRepoURL("http://someserver/something", "nginx", g); err == nil {
|
|
|
|
|
t.Errorf("Expected error for bad chart URL, but did not get any errors")
|
|
|
|
|
t.Error("Expected error for bad chart URL, but did not get any errors")
|
|
|
|
|
} else if !strings.Contains(err.Error(), `looks like "http://someserver/something" is not a valid chart repository or cannot be reached`) {
|
|
|
|
|
t.Errorf("Expected error for bad chart URL, but got a different error (%v)", err)
|
|
|
|
|
}
|
|
|
|
|
@ -252,22 +252,22 @@ func TestErrorFindChartInRepoURL(t *testing.T) {
|
|
|
|
|
defer srv.Close()
|
|
|
|
|
|
|
|
|
|
if _, err = FindChartInRepoURL(srv.URL, "nginx1", g); err == nil {
|
|
|
|
|
t.Errorf("Expected error for chart not found, but did not get any errors")
|
|
|
|
|
t.Error("Expected error for chart not found, but did not get any errors")
|
|
|
|
|
} else if err.Error() != `chart "nginx1" not found in `+srv.URL+` repository` {
|
|
|
|
|
t.Errorf("Expected error for chart not found, but got a different error (%v)", err)
|
|
|
|
|
}
|
|
|
|
|
if !errors.Is(err, ChartNotFoundError{}) {
|
|
|
|
|
t.Errorf("error is not of correct error type structure")
|
|
|
|
|
t.Error("error is not of correct error type structure")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if _, err = FindChartInRepoURL(srv.URL, "nginx1", g, WithChartVersion("0.1.0")); err == nil {
|
|
|
|
|
t.Errorf("Expected error for chart not found, but did not get any errors")
|
|
|
|
|
t.Error("Expected error for chart not found, but did not get any errors")
|
|
|
|
|
} else if err.Error() != `chart "nginx1" version "0.1.0" not found in `+srv.URL+` repository` {
|
|
|
|
|
t.Errorf("Expected error for chart not found, but got a different error (%v)", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if _, err = FindChartInRepoURL(srv.URL, "chartWithNoURL", g); err == nil {
|
|
|
|
|
t.Errorf("Expected error for no chart URLs available, but did not get any errors")
|
|
|
|
|
t.Error("Expected error for no chart URLs available, but did not get any errors")
|
|
|
|
|
} else if err.Error() != `chart "chartWithNoURL" has no downloadable URLs` {
|
|
|
|
|
t.Errorf("Expected error for chart not found, but got a different error (%v)", err)
|
|
|
|
|
}
|
|
|
|
|
|