Skip to content

Commit 7d7bcde

Browse files
committed
Improve cacert detection.
We checked for two leading spaces when searching for the cloud name. YAML allows for various ways of indentation, so this was in no way safe. Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent 772eb58 commit 7d7bcde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

04-cloud-secret.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kubectl create namespace "$CS_NAMESPACE" || true
2020
# - The cloud should be called openstack
2121
# - We will detect a cacert in there and pass it to the helper chart
2222
if ! test -r "$CLOUDS_YAML"; then echo "clouds.yaml $CLOUDS_YAML not readable"; exit 2; fi
23-
CA=$(grep -A11 "^ $OS_CLOUD:" $CLOUDS_YAML | grep 'cacert:' | sed 's/^ *cacert: //')
23+
CA=$(grep -A12 "^ *$OS_CLOUD: *$" $CLOUDS_YAML | grep 'cacert:' | sed 's/^ *cacert: //')
2424
OS_CACERT=${OS_CACERT:-$CA}
2525
if test -n "$OS_CACERT"; then
2626
# Call the helm helper chart now

0 commit comments

Comments
 (0)