Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crane's root.go after DefaultTransport change #1450

Merged
merged 1 commit into from Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 5 additions & 8 deletions cmd/crane/cmd/root.go
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