From ba57db37d649e43cf11d1d0646494ccf2fbdad15 Mon Sep 17 00:00:00 2001 From: Otavio Rodolfo Piske Date: Tue, 16 Mar 2021 17:53:32 +0100 Subject: [PATCH] fix: change prioritization of the insecure flag check to ensure it works with mixed secure/insecure registries --- pkg/trait/builder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go index 635ce5bd64..d3a77734c9 100644 --- a/pkg/trait/builder.go +++ b/pkg/trait/builder.go @@ -270,7 +270,9 @@ func (t *builderTrait) buildahTask(e *Environment) (*v1.ImageTask, error) { }) } mountRegistrySecret(e.Platform.Status.Build.Registry.Secret, secret, &volumes, &volumeMounts, &env) - } else if e.Platform.Status.Build.Registry.Insecure { + } + + if e.Platform.Status.Build.Registry.Insecure { bud = append(bud[:2], append([]string{"--tls-verify=false"}, bud[2:]...)...) push = append(push[:2], append([]string{"--tls-verify=false"}, push[2:]...)...) }