Skip to content

Commit cd5aec9

Browse files
committed
Use container's system CA trust store
Previously it was not possible to use this image in an environment with a CA that is not trusted by the Python trust store. This is because the rally-verify-wrapper.sh script unset any OS_CACERT environment variable (presumably assuming any CA cert would not necessarily be available in the container). This change makes it possible to bind mount CA certificates in the container under /usr/local/share/ca-certificates/ and have them added to the system trust store and used by Rally/Tempest. In this case, OS_CACERT is set automatically. If there are no certificates in /usr/local/share/ca-certificates/, we revert to the previous behaviour of unsetting OS_CACERT.
1 parent 5fbe471 commit cd5aec9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bin/rally-verify-wrapper.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,16 @@ else
7878
fi
7979
set -x
8080

81-
unset OS_CACERT
81+
if [[ -z "$(sudo ls -A /usr/local/share/ca-certificates)" ]]; then
82+
# Assume that any CA certificate referenced in the openrc file will not be
83+
# valid within the container.
84+
unset OS_CACERT
85+
else
86+
# Use the container's system CA trust store. This allows for bind mounting a CA
87+
# certificate under /usr/local/share/ca-certificates/.
88+
sudo update-ca-certificates
89+
export OS_CACERT=/etc/ssl/certs/ca-certificates.crt
90+
fi
8291

8392
crudini --set ~/.rally/rally.conf DEFAULT openstack_client_http_timeout 300
8493
crudini --set ~/.rally/rally.conf openstack flavor_ref_ram 128

0 commit comments

Comments
 (0)