Implement separation between Insecure (HTTP) registry and skipping TLS verification into two separate command line parameters

This commit is contained in:
Sebastian Jackel
2018-08-30 09:34:31 +02:00
parent bb75c04618
commit 4ba6148621
3 changed files with 17 additions and 15 deletions
+2 -2
View File
@@ -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,
}