This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push:
new e0486ce fix: only assume secure pull if the main registry and the
base image registry are different
e0486ce is described below
commit e0486ce9f336dddc6d08d4c5d061058cb53fb740
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Mar 15 13:03:04 2021 +0100
fix: only assume secure pull if the main registry and the base image
registry are different
---
pkg/builder/spectrum/publisher.go | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/pkg/builder/spectrum/publisher.go
b/pkg/builder/spectrum/publisher.go
index d47f955..315e548 100644
--- a/pkg/builder/spectrum/publisher.go
+++ b/pkg/builder/spectrum/publisher.go
@@ -23,6 +23,7 @@ import (
"os"
"path"
"path/filepath"
+ "strings"
"github.com/apache/camel-k/pkg/builder"
"github.com/apache/camel-k/pkg/platform"
@@ -62,9 +63,15 @@ func publisher(ctx *builder.Context) error {
}
pullInsecure := pl.Status.Build.Registry.Insecure // incremental build
case
- if ctx.BaseImage == pl.Status.Build.BaseImage {
- // Assuming the base image is always secure (we should add a
flag)
- pullInsecure = false
+
+ log.Debugf("Registry address: %s", pl.Status.Build.Registry.Address)
+ log.Debugf("Base image: %s", ctx.BaseImage)
+
+ if !strings.HasPrefix(ctx.BaseImage, pl.Status.Build.Registry.Address) {
+ if pullInsecure {
+ log.Info("Assuming secure pull because the registry for
the base image and the main registry are different")
+ pullInsecure = false
+ }
}
registryConfigDir := ""