Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/oras.land/oras-go/v2-2…
Browse files Browse the repository at this point in the history
….3.0
  • Loading branch information
absoludity authored Sep 5, 2023
2 parents 2bfabd5 + b99592d commit 0550a1d
Show file tree
Hide file tree
Showing 22 changed files with 747 additions and 897 deletions.
12 changes: 6 additions & 6 deletions cmd/asset-syncer/server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type ChartCatalog interface {
type HelmRepo struct {
content []byte
*models.AppRepositoryInternal
netClient httpclient.Client
netClient *http.Client
filter *apprepov1alpha1.FilterRuleSpec
}

Expand Down Expand Up @@ -303,7 +303,7 @@ type OCIRegistry struct {
filter *apprepov1alpha1.FilterRuleSpec
}

func doReq(url string, cli httpclient.Client, headers map[string]string, userAgent string) ([]byte, error) {
func doReq(url string, cli *http.Client, headers map[string]string, userAgent string) ([]byte, error) {
headers["User-Agent"] = userAgent
return httpclient.Get(url, cli, headers)
}
Expand Down Expand Up @@ -342,7 +342,7 @@ type OciAPIClient struct {
RegistryNamespaceUrl *url.URL
// The HttpClient is used for all http requests to the OCI Distribution
// spec API.
HttpClient httpclient.Client
HttpClient *http.Client
// The GrpcClient is used when querying our OCI Catalog service, which
// aims to work around some of the shortfalls of the OCI Distribution spec
// API
Expand Down Expand Up @@ -781,7 +781,7 @@ func parseFilters(filters string) (*apprepov1alpha1.FilterRuleSpec, error) {
return filterSpec, nil
}

func getHelmRepo(namespace, name, repoURL, authorizationHeader string, filter *apprepov1alpha1.FilterRuleSpec, netClient httpclient.Client, userAgent string) (ChartCatalog, error) {
func getHelmRepo(namespace, name, repoURL, authorizationHeader string, filter *apprepov1alpha1.FilterRuleSpec, netClient *http.Client, userAgent string) (ChartCatalog, error) {
url, err := parseRepoURL(repoURL)
if err != nil {
log.Errorf("Failed to parse URL, url=%s: %v", repoURL, err)
Expand Down Expand Up @@ -834,7 +834,7 @@ func getOCIRepo(namespace, name, repoURL, authorizationHeader string, filter *ap
}, nil
}

func fetchRepoIndex(url, authHeader string, cli httpclient.Client, userAgent string) ([]byte, error) {
func fetchRepoIndex(url, authHeader string, cli *http.Client, userAgent string) ([]byte, error) {
indexURL, err := parseRepoURL(url)
if err != nil {
log.Errorf("Failed to parse URL, url=%s: %v", url, err)
Expand Down Expand Up @@ -863,7 +863,7 @@ func chartTarballURL(r *models.AppRepositoryInternal, cv models.ChartVersion) st

type fileImporter struct {
manager assetManager
netClient httpclient.Client
netClient *http.Client
}

func (f *fileImporter) fetchFiles(charts []models.Chart, repo ChartCatalog, userAgent string, passCredentials bool) {
Expand Down
Loading

0 comments on commit 0550a1d

Please sign in to comment.