ci: tdx: Adapt how we get the host IP

In the process of switching the TDX CI machine we've noticed that
`hostname -i` in one of the machines returns an one and only IP address,
while in another machine it returns a full list of IPs.

As we're only interested in the first one, let's adapt the code to
always return the first one.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
This commit is contained in:
Fabiano Fidêncio 2024-09-11 09:31:43 +02:00
parent d0968032f7
commit 3946aa7283
No known key found for this signature in database
GPG Key ID: EE926C2BDACC177B

View File

@ -311,7 +311,7 @@ function kbs_k8s_deploy() {
echo "Setting up custom PCCS for TDX"
cat <<- EOF > "${COCO_KBS_DIR}/config/kubernetes/custom_pccs/sgx_default_qcnl.conf"
{
"pccs_url": "https://$(hostname -i):8081/sgx/certification/v4/",
"pccs_url": "https://$(hostname -i | grep -o "^[0-9.]*"):8081/sgx/certification/v4/",
// To accept insecure HTTPS certificate, set this option to false
"use_secure_cert": false