Skip to content

Commit

Permalink
fix: only assume secure pull if the main registry and the base image …
Browse files Browse the repository at this point in the history
…registry are different
  • Loading branch information
orpiske authored and astefanutti committed Mar 15, 2021
1 parent a112bfe commit e0486ce
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/builder/spectrum/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path"
"path/filepath"
"strings"

"github.com/apache/camel-k/pkg/builder"
"github.com/apache/camel-k/pkg/platform"
Expand Down Expand Up @@ -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 := ""
Expand Down

0 comments on commit e0486ce

Please sign in to comment.