mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
Merge pull request #8688 from microsoft/danmihai1/k8s-confidential
tests: retry connection to pod SSH server
This commit is contained in:
commit
d916da15dd
@ -30,15 +30,19 @@ setup() {
|
|||||||
# Check pod creation
|
# Check pod creation
|
||||||
kubectl wait --for=condition=Ready --timeout=$timeout pod "${pod_name}"
|
kubectl wait --for=condition=Ready --timeout=$timeout pod "${pod_name}"
|
||||||
|
|
||||||
pod_ip=$(kubectl get pod -o wide | grep "confidential-unencrypted" | awk '{print $6;}')
|
coco_enabled=""
|
||||||
|
for i in {1..6}; do
|
||||||
# Run the remote command
|
if ! pod_ip=$(kubectl get pod -o wide | grep "confidential-unencrypted" | awk '{print $6;}'); then
|
||||||
coco_enabled=$(ssh -i ${SSH_KEY_FILE} -o "StrictHostKeyChecking no" -o "PasswordAuthentication=no" root@${pod_ip} /bin/sh -c "$(get_remote_command_per_hypervisor)" || true)
|
warn "Failed to get pod IP address."
|
||||||
|
else
|
||||||
if [ -z "$coco_enabled" ]; then
|
info "Pod IP address: ${pod_ip}"
|
||||||
>&2 echo -e "Confidential compute is expected but not enabled."
|
coco_enabled=$(ssh -i ${SSH_KEY_FILE} -o "StrictHostKeyChecking no" -o "PasswordAuthentication=no" root@${pod_ip} /bin/sh -c "$(get_remote_command_per_hypervisor)") && break
|
||||||
return 1
|
warn "Failed to connect to pod."
|
||||||
fi
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
[ -z "$coco_enabled" ] && die "Confidential compute is expected but not enabled."
|
||||||
|
info "ssh client output: ${coco_enabled}"
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
|
Loading…
Reference in New Issue
Block a user