Skip to content

Commit d9b85d8

Browse files
authored
Merge pull request #8 from SovereignCloudStack/fix/avoid-commented-out
Avoid using commented out cacert: setting.
2 parents ae61a41 + 471a72d commit d9b85d8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

04-cloud-secret.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ 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 -A12 "^\s\s*$OS_CLOUD:\s*\$" $CLOUDS_YAML | grep 'cacert:' | head -n1 | sed 's/^ *cacert: //')
24-
OS_CACERT=${OS_CACERT:-$CA}
23+
CA=$(grep -A12 "^\s\s*$OS_CLOUD:\s*\$" $CLOUDS_YAML | grep '^\s*cacert:' | head -n1 | tr -d '"' | sed 's/^\s*cacert: *//')
24+
# This would be the safe way using yq:
25+
# CA=$(yq -y < $CLOUDS_YAML '.clouds."'$OS_CLOUD'".cacert' | head -n1); if test "$CA" = "null"; then unset CA; fi
26+
OS_CACERT="${OS_CACERT:-$CA}"
2527
# FIXME: We will provide more settings in cluster-settings.env later, hardcode it for now
2628
#if test "$CS_CCMLB=octavia-ovn"; then OCTOVN="--set octavia_ovn=true"; else unset OCTOVN; fi
2729
OCTOVN="--set octavia_ovn=true"

0 commit comments

Comments
 (0)