Skip to content

Commit

Permalink
fix: ensure Kaniko build strategy works with insecure registries
Browse files Browse the repository at this point in the history
  • Loading branch information
orpiske authored and astefanutti committed Mar 15, 2021
1 parent e0486ce commit 55f74d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/trait/builder.go
Expand Up @@ -342,9 +342,15 @@ func (t *builderTrait) kanikoTask(e *Environment) (*v1.ImageTask, error) {
return nil, err
}
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 {
args = append(args, "--insecure")
args = append(args, "--insecure-pull")

// We use these 2 flags to force Kaniko to try HTTP instead of HTTPS
args = append(args, "--skip-tls-verify")
args = append(args, "--skip-tls-verify-pull")
}

env = append(env, proxySecretEnvVars(e)...)
Expand Down

0 comments on commit 55f74d3

Please sign in to comment.