Skip to content

Commit 85e6940

Browse files
committed
Retry endpoint cert fingerprint check in tls-cert-rotation kuttl test
The ctlplane-tls-cert-rotation kuttl test can fail because it collects endpoint TLS fingerprints before service pods have restarted with the new certificates. Replace the one-shot fingerprint check with a retry loop that polls until all endpoint certs have rotated. Change-Id: I50bd0cd57b05cbf88bcf77b7835d7c23f06694b4 Signed-off-by: rabi <ramishra@redhat.com>
1 parent ed19ffe commit 85e6940

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

test/kuttl/tests/ctlplane-tls-cert-rotation/04-assert-service-cert-rotation.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ commands:
77
NAMESPACE=$NAMESPACE bash ../../common/osp_check_noapi_service_certs.sh
88
99
- script: |
10-
echo "Get fingerprints of all service certs"
10+
echo "Checking endpoint cert rotation..."
11+
for i in $(seq 1 30); do
12+
oc exec -i openstackclient -n $NAMESPACE -- bash -s < ../../common/osp_endpoint_fingerprints.sh > /tmp/endpoint_fingerprints_after
13+
if bash ../../common/osp_check_fingerprints.sh 2>/dev/null; then
14+
echo "All endpoint certs rotated successfully."
15+
exit 0
16+
fi
17+
echo "Attempt $i/30: Not all certs rotated yet, waiting 20s..."
18+
sleep 20
19+
done
20+
echo "Collecting final fingerprints for failure diagnostics..."
1121
oc exec -i openstackclient -n $NAMESPACE -- bash -s < ../../common/osp_endpoint_fingerprints.sh > /tmp/endpoint_fingerprints_after
12-
13-
- script: |
14-
echo "Check if all services from before are present in after and have valid fingerprints"
1522
bash -s < ../../common/osp_check_fingerprints.sh

0 commit comments

Comments
 (0)