Skip to content

Commit

Permalink
Custom CA bundle for prefetch-dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Hebert <[email protected]>
  • Loading branch information
scoheb authored and chmeliik committed Apr 17, 2024
1 parent b1f0b12 commit c5ea8d8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions task/prefetch-dependencies/0.1/prefetch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ spec:
notice. Use at your own risk.
name: dev-package-managers
default: "false"
- name: caTrustConfigMapName
type: string
description: The name of the ConfigMap to read CA bundle data from.
default: trusted-ca
- name: caTrustConfigMapKey
type: string
description: The name of the key in the ConfigMap that contains the CA bundle data.
default: ca-bundle.crt
steps:
- image: quay.io/redhat-appstudio/cachi2:0.7.0@sha256:1fc772aa3636fd0b43d62120d832e5913843e028e8cac42814b487c3a0a32bd8
# per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
Expand All @@ -30,6 +38,10 @@ spec:
value: $(params.input)
- name: DEV_PACKAGE_MANAGERS
value: $(params.dev-package-managers)
volumeMounts:
- name: trusted-ca
mountPath: /mnt/trusted-ca
readOnly: true
script: |
if [ -z "${INPUT}" ]
then
Expand All @@ -43,6 +55,13 @@ spec:
dev_pacman_flag=""
fi
ca_bundle=/mnt/trusted-ca/ca-bundle.crt
if [ -f "$ca_bundle" ]; then
echo "INFO: Using mounted CA bundle: $ca_bundle"
cp -vf $ca_bundle /etc/pki/ca-trust/source/anchors
update-ca-trust
fi
cachi2 fetch-deps \
$dev_pacman_flag \
--source=$(workspaces.source.path)/source \
Expand All @@ -59,3 +78,11 @@ spec:
workspaces:
- name: source
description: Workspace with the source code, cachi2 artifacts will be stored on the workspace as well
volumes:
- name: trusted-ca
configMap:
name: $(params.caTrustConfigMapName)
items:
- key: $(params.caTrustConfigMapKey)
path: ca-bundle.crt
optional: true

0 comments on commit c5ea8d8

Please sign in to comment.