Ensure Kata is deloyed before testing 14/4514/1
authorTodd Malsbary <todd.malsbary@intel.com>
Mon, 15 Nov 2021 23:53:31 +0000 (15:53 -0800)
committerTodd Malsbary <todd.malsbary@intel.com>
Mon, 22 Nov 2021 23:16:25 +0000 (15:16 -0800)
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I8510426098f8e64e0d881912ec4d2709f12ad778

deploy/kata/kata.sh

index ec3ade4..75ca024 100755 (executable)
@@ -64,12 +64,21 @@ function clean_webhook {
     kustomize build ${BUILDDIR}/webhook/base | KUBECONFIG=${cluster_kubeconfig} kubectl delete -f -
 }
 
+function is_kata_deployed {
+    local -r cluster_name=${CLUSTER_NAME:-e2etest}
+    local -r cluster_kubeconfig="${BUILDDIR}/${cluster_name}.conf"
+    kubectl --kubeconfig=${cluster_kubeconfig} get runtimeclass/kata-qemu
+}
+
 function test_kata {
     # Create a temporary kubeconfig file for the tests
     local -r cluster_name=${CLUSTER_NAME:-e2etest}
     local -r cluster_kubeconfig="${BUILDDIR}/${cluster_name}.conf"
     clusterctl -n metal3 get kubeconfig ${cluster_name} >${cluster_kubeconfig}
 
+    # Ensure that Kata has been deployed first
+    wait_for is_kata_deployed
+
     deploy_webhook ${cluster_name}
     clone_kud_repository
     pushd ${KUDPATH}/kud/tests