Skip to content

Commit

Permalink
Custom CA bundle for prefetch-dependencies for build-task
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwindasr committed May 16, 2024
1 parent a8a634e commit 206f7e8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ spec:
description: Path to a file with build arguments which will be passed to podman during build
type: string
default: ""
- 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

results:
- description: Digest of the image just built
Expand Down Expand Up @@ -274,6 +282,9 @@ spec:
name: varlibcontainers
- mountPath: "/entitlement"
name: etc-pki-entitlement
- name: trusted-ca
mountPath: /mnt/trusted-ca
readOnly: true
workingDir: $(workspaces.source.path)

- name: sbom-syft-generate
Expand Down Expand Up @@ -414,6 +425,13 @@ spec:
echo "Failed to push sbom image to registry after ${max_run} tries"
exit 1
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
cat "$(workspaces.source.path)"/image-digest | tee $(results.IMAGE_DIGEST.path)
echo -n "$IMAGE" | tee $(results.IMAGE_URL.path)
Expand Down Expand Up @@ -447,6 +465,13 @@ spec:
secret:
secretName: $(params.ENTITLEMENT_SECRET)
optional: true
- name: trusted-ca
configMap:
name: $(params.caTrustConfigMapName)
items:
- key: $(params.caTrustConfigMapKey)
path: ca-bundle.crt
optional: true
workspaces:
- name: source
description: Workspace containing the source code to build.

0 comments on commit 206f7e8

Please sign in to comment.