Skip to content

Commit

Permalink
fix crane's root.go after DefaultTransport change (#1450)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Sep 20, 2022
1 parent e3b94c7 commit 9a5c14a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cmd/crane/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ func New(use, short string, options []crane.Option) *cobra.Command {

options = append(options, crane.WithPlatform(platform.platform))

rt := remote.DefaultTransport
if t, ok := remote.DefaultTransport.(interface {
Clone() *http.Transport
}); ok {
t := t.Clone()
t.TLSClientConfig = &tls.Config{
InsecureSkipVerify: insecure, //nolint: gosec
}
transport := remote.DefaultTransport.(*http.Transport).Clone()
transport.TLSClientConfig = &tls.Config{
InsecureSkipVerify: insecure, //nolint: gosec
}

var rt http.RoundTripper = transport

// Add any http headers if they are set in the config file.
cf, err := config.Load(os.Getenv("DOCKER_CONFIG"))
if err != nil {
Expand Down

0 comments on commit 9a5c14a

Please sign in to comment.