Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/pipelines/tekton/task-buildpack.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ spec:
- name: PLATFORM_DIR
description: The name of the platform directory.
default: empty-dir
- name: INSECURE_REGISTRIES
description: Registries to access without TLS verification
default: ""
stepTemplate:
env:
- name: CNB_PLATFORM_API
Expand Down Expand Up @@ -199,6 +202,8 @@ spec:
env:
- name: DOCKER_CONFIG
value: $(workspaces.dockerconfig.path)
- name: CNB_INSECURE_REGISTRIES
value: $(params.INSECURE_REGISTRIES)
args:
- "-app=$(workspaces.source.path)/$(params.SOURCE_SUBPATH)"
- "-cache-dir=$(workspaces.cache.path)"
Expand Down
16 changes: 16 additions & 0 deletions pkg/pipelines/tekton/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,19 @@ type templateData struct {
// createPipelineTemplatePAC creates a Pipeline template used for PAC on-cluster build
// it creates the resource in the project directory
func createPipelineTemplatePAC(f fn.Function, labels map[string]string) error {
// Determine if TLS verification should be skipped
tlsVerify := "true"
if f.RegistryInsecure || isInsecureRegistry(f.Registry) {
tlsVerify = "false"
}

data := templateData{
FunctionName: f.Name,
Annotations: f.Deploy.Annotations,
Labels: labels,
PipelineName: getPipelineName(f),
TlsVerify: tlsVerify,
Registry: f.Registry,
}

for _, val := range []struct {
Expand Down Expand Up @@ -294,11 +302,19 @@ func createAndApplyPipelineTemplate(f fn.Function, namespace string, labels map[
// If Git is set up create fetch task and reference it from build task,
// otherwise sources have been already uploaded to workspace PVC.

// Determine if TLS verification should be skipped
tlsVerify := "true"
if f.RegistryInsecure || isInsecureRegistry(f.Registry) {
tlsVerify = "false"
}

data := templateData{
FunctionName: f.Name,
Annotations: f.Deploy.Annotations,
Labels: labels,
PipelineName: getPipelineName(f),
Registry: f.Registry,
TlsVerify: tlsVerify,
}

for _, val := range []struct {
Expand Down
4 changes: 4 additions & 0 deletions pkg/pipelines/tekton/templates_pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:
- name: ENV_VARS
value:
- '$(params.buildEnvs[*])'
{{- if eq .TlsVerify "false"}}
- name: INSECURE_REGISTRIES
value: $(params.registry)
{{- end}}
{{.FuncBuildpacksTaskRef}}
workspaces:
- name: source
Expand Down
Loading