mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 12:04:11 +02:00
Implement separation between Insecure (HTTP) registry and skipping TLS verification into two separate command line parameters
This commit is contained in:
@@ -67,7 +67,7 @@ func DoPush(image v1.Image, opts *options.KanikoOptions) error {
|
||||
|
||||
// continue pushing unless an error occurs
|
||||
for _, destRef := range destRefs {
|
||||
if opts.DockerInsecureSkipTLSVerify {
|
||||
if opts.DockerInsecure {
|
||||
newReg, err := name.NewInsecureRegistry(destRef.Repository.Registry.Name(), name.WeakValidation)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "getting new insecure registry")
|
||||
@@ -87,7 +87,7 @@ func DoPush(image v1.Image, opts *options.KanikoOptions) error {
|
||||
|
||||
// Create a transport to set our user-agent.
|
||||
tr := http.DefaultTransport
|
||||
if opts.DockerInsecureSkipTLSVerify {
|
||||
if opts.SkipTlsVerify {
|
||||
tr.(*http.Transport).TLSClientConfig = &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user