Merge pull request #32034 from cairon-ab/fix/pull-debug-output

fix: add debug logging to HTTP getter for helm pull
pull/32090/head
Terry Howe 3 months ago committed by GitHub
commit 38f3704983
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,6 +20,7 @@ import (
"crypto/tls"
"fmt"
"io"
"log/slog"
"net/http"
"net/url"
"sync"
@ -87,11 +88,13 @@ func (g *HTTPGetter) get(href string, opts getterOptions) (*bytes.Buffer, error)
return nil, err
}
slog.Debug("fetching", "url", href)
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
slog.Debug("fetch complete", "url", href, "status", resp.Status, "content-length", resp.ContentLength)
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to fetch %s : %s", href, resp.Status)
}

Loading…
Cancel
Save