Skip to content

Commit 57840dd

Browse files
committed
chore(KFLUXVNGD-148): Add custom certificate support for git clone task
Add param to support the custom certificate support for git-clone-oci-ta task to connect to internal registry. Jira-Url: https://issues.redhat.com/browse/KFLUXVNGD-155 Signed-off-by: Homaja Marisetty <[email protected]>
1 parent a07704d commit 57840dd

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

task-generator/trusted-artifacts/golden/git-clone/ta.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ spec:
265265
volumeMounts:
266266
- name: workdir
267267
mountPath: /var/workdir
268+
- mountPath: /etc/pki/tls/certs/ca-custom-bundle.crt
269+
name: trusted-ca
270+
readOnly: true
271+
subPath: ca-bundle.crt
268272
args:
269273
- create
270274
- --store

task-generator/trusted-artifacts/ta.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ func perform(task *pipeline.Task, recipe *Recipe) error {
159159
Name: "workdir",
160160
MountPath: "/var/workdir",
161161
}
162+
trustedVolumeMount := core.VolumeMount{
163+
Name: "trusted-ca",
164+
MountPath: "/etc/pki/tls/certs/ca-custom-bundle.crt",
165+
SubPath: "ca-bundle.crt",
166+
ReadOnly: true,
167+
}
162168
if len(recipe.AddVolumeMount) == 0 {
163169
recipe.AddVolumeMount = []core.VolumeMount{workdirVolumeMount}
164170
}
@@ -348,7 +354,7 @@ func perform(task *pipeline.Task, recipe *Recipe) error {
348354
}
349355

350356
if task.Spec.StepTemplate == nil && !recipe.PreferStepTemplate {
351-
create.VolumeMounts = []core.VolumeMount{workdirVolumeMount}
357+
create.VolumeMounts = []core.VolumeMount{workdirVolumeMount, trustedVolumeMount}
352358
}
353359
task.Spec.Steps = append(task.Spec.Steps, create)
354360
}

task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ spec:
307307
volumeMounts:
308308
- mountPath: /var/workdir
309309
name: workdir
310+
- mountPath: /etc/pki/tls/certs/ca-custom-bundle.crt
311+
name: trusted-ca
312+
readOnly: true
313+
subPath: ca-bundle.crt
310314
env:
311315
- name: IMAGE_EXPIRES_AFTER
312316
value: $(params.ociArtifactExpiresAfter)

0 commit comments

Comments
 (0)