Skip to content

Commit c35d124

Browse files
committed
Try fallbacks for /etc/pki when it does not exist
1 parent 82d3e26 commit c35d124

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/pattern-util.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ if [ -n "$KUBECONFIG" ]; then
4848
exit 1
4949
fi
5050
fi
51+
52+
# Use /etc/pki by default and try a couple of fallbacks if it does not exist
53+
if [ -d /etc/pki ]; then
54+
PKI_HOST_MOUNT="/etc/pki"
55+
elif [ -d /etc/ssl ]; then
56+
PKI_HOST_MOUNT="/etc/ssl"
57+
else
58+
PKI_HOST_MOUNT="/usr/share/ca-certificates"
59+
fi
60+
5161
# Copy Kubeconfig from current environment. The utilities will pick up ~/.kube/config if set so it's not mandatory
5262
# $HOME is mounted as itself for any files that are referenced with absolute paths
5363
# $HOME is mounted to /root because the UID in the container is 0 and that's where SSH looks for credentials
@@ -57,7 +67,7 @@ podman run -it --rm --pull=newer \
5767
-e EXTRA_HELM_OPTS \
5868
-e EXTRA_PLAYBOOK_OPTS \
5969
-e KUBECONFIG \
60-
-v /etc/pki:/etc/pki:ro \
70+
-v "${PKI_HOST_MOUNT}":/etc/pki:ro \
6171
-v "${HOME}":"${HOME}" \
6272
-v "${HOME}":/pattern-home \
6373
${PODMAN_ARGS} \

0 commit comments

Comments
 (0)