Skip to content

Commit

Permalink
Move FetchChartDetailFromTarballUrl from tarutils to assets-syncer
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ruiz <[email protected]>
  • Loading branch information
migruiz4 committed Dec 23, 2024
1 parent 5caa0a5 commit 021d6de
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pkg/tarutil/tarutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,13 @@ import (
"bytes"
"compress/gzip"
"io"
"net/http"
"path"
"regexp"
"strings"

chart "github.com/vmware-tanzu/kubeapps/pkg/chart/models"
httpclient "github.com/vmware-tanzu/kubeapps/pkg/http-client"
)

// Fetches helm chart details from a gzipped tarball
//
// name is expected in format "foo/bar" or "foo%2Fbar" if url-escaped
func FetchChartDetailFromTarballUrl(chartTarballURL string, userAgent string, authz string, netClient *http.Client) (map[string]string, error) {
reqHeaders := make(map[string]string)
if len(userAgent) > 0 {
reqHeaders["User-Agent"] = userAgent
}
if len(authz) > 0 {
reqHeaders["Authorization"] = authz
}

// use our "standard" http-client library
reader, _, err := httpclient.GetStream(chartTarballURL, netClient, reqHeaders)
if reader != nil {
defer reader.Close()
}

if err != nil {
return nil, err
}

return FetchChartDetailFromTarball(reader)
}

// Fetches helm chart details from a gzipped tarball
//
// name is expected in format "foo/bar" or "foo%2Fbar" if url-escaped
Expand Down

0 comments on commit 021d6de

Please sign in to comment.