changed strategy based on conversation with Adam

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
pull/7835/head
Matt Butcher 6 years ago
parent 113dec6ff0
commit 8fef13fa24
No known key found for this signature in database
GPG Key ID: DCD5F5E5EF32C345

@ -18,7 +18,6 @@ package getter
import (
"bytes"
"crypto/tls"
"fmt"
"io"
"net/http"
@ -68,10 +67,7 @@ func (g *HTTPGetter) get(href string) (*bytes.Buffer, error) {
resp, err := client.Do(req)
if err != nil {
// In Go 1.14, the error returned from client.Do changed.
// This is for backward compatibility, so that tests will pass
// for Go 1.13 and before as well as 1.14 and beyond.
return buf, fmt.Errorf("Get %s: %s", href, err)
return buf, err
}
if resp.StatusCode != 200 {
return buf, errors.Errorf("failed to fetch %s : %s", href, resp.Status)

@ -308,7 +308,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")
} else if !strings.Contains(err.Error(), `looks like "http://someserver/something" is not a valid chart repository or cannot be reached: Get http://someserver/something/index.yaml`) {
} 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)
}

Loading…
Cancel
Save