Skip to content

Commit

Permalink
fix http client to push sbom accessory (#20525)
Browse files Browse the repository at this point in the history
Signed-off-by: wang yan <[email protected]>
  • Loading branch information
wy65701436 authored May 31, 2024
1 parent d847590 commit 7645ec7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/pkg/scan/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package scan

import (
"fmt"
"net/http"

"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
Expand All @@ -29,22 +28,14 @@ import (
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

commonhttp "github.com/goharbor/harbor/src/common/http"
"github.com/goharbor/harbor/src/lib/log"
http_common "github.com/goharbor/harbor/src/common/http"
"github.com/goharbor/harbor/src/pkg/robot/model"
v1sq "github.com/goharbor/harbor/src/pkg/scan/rest/v1"
)

// RemoteOptions ...
func RemoteOptions() []remote.Option {
tr := http.DefaultTransport.(*http.Transport).Clone()
if commonhttp.InternalEnableVerifyClientCert() {
tlsConfig, err := commonhttp.GetInternalTLSConfig()
if err != nil {
log.Errorf("SBOM client load cert file with err: %v", err)
}
tr.TLSClientConfig = tlsConfig
}
tr := http_common.GetHTTPTransport(http_common.WithInsecure(true))
return []remote.Option{remote.WithTransport(tr)}
}

Expand Down

0 comments on commit 7645ec7

Please sign in to comment.