Code Review
/
icn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
update the committers for icn
[icn.git]
/
deploy
/
kata
/
kata.sh
diff --git
a/deploy/kata/kata.sh
b/deploy/kata/kata.sh
index
ec3ade4
..
39aa8ee
100755
(executable)
--- a/
deploy/kata/kata.sh
+++ b/
deploy/kata/kata.sh
@@
-10,9
+10,6
@@
source $LIBDIR/common.sh
BUILDDIR=${SCRIPTDIR/deploy/build}
mkdir -p ${BUILDDIR}
BUILDDIR=${SCRIPTDIR/deploy/build}
mkdir -p ${BUILDDIR}
-KATA_VERSION="2.1.0-rc0"
-KATA_WEBHOOK_VERSION="2.1.0-rc0"
-
KATA_DEPLOY_URL="https://raw.githubusercontent.com/kata-containers/kata-containers/${KATA_VERSION}/tools/packaging/kata-deploy"
KATA_WEBHOOK_URL="https://raw.githubusercontent.com/kata-containers/tests/${KATA_WEBHOOK_VERSION}/kata-webhook"
KATA_WEBHOOK_DIR="/opt/src/kata_webhook"
KATA_DEPLOY_URL="https://raw.githubusercontent.com/kata-containers/kata-containers/${KATA_VERSION}/tools/packaging/kata-deploy"
KATA_WEBHOOK_URL="https://raw.githubusercontent.com/kata-containers/tests/${KATA_WEBHOOK_VERSION}/kata-webhook"
KATA_WEBHOOK_DIR="/opt/src/kata_webhook"
@@
-25,6
+22,7
@@
function build_source {
curl -sL ${KATA_DEPLOY_URL}/kata-rbac/base/kata-rbac.yaml -o ${SCRIPTDIR}/base/kata-rbac.yaml
curl -sL ${KATA_DEPLOY_URL}/kata-deploy/base/kata-deploy.yaml -o ${SCRIPTDIR}/base/kata-deploy.yaml
curl -sL ${KATA_DEPLOY_URL}/runtimeclasses/kata-runtimeClasses.yaml -o ${SCRIPTDIR}/base/kata-runtimeClasses.yaml
curl -sL ${KATA_DEPLOY_URL}/kata-rbac/base/kata-rbac.yaml -o ${SCRIPTDIR}/base/kata-rbac.yaml
curl -sL ${KATA_DEPLOY_URL}/kata-deploy/base/kata-deploy.yaml -o ${SCRIPTDIR}/base/kata-deploy.yaml
curl -sL ${KATA_DEPLOY_URL}/runtimeclasses/kata-runtimeClasses.yaml -o ${SCRIPTDIR}/base/kata-runtimeClasses.yaml
+ rm -f ${SCRIPTDIR}/base/kustomization.yaml
pushd ${SCRIPTDIR}/base && kustomize create --autodetect && popd
}
pushd ${SCRIPTDIR}/base && kustomize create --autodetect && popd
}
@@
-37,6
+35,7
@@
function deploy_webhook {
# create-certs.sh takes care of converting the .yaml.tpl into the
# .yaml file
mkdir -p ${BUILDDIR}/webhook/base/deploy
# create-certs.sh takes care of converting the .yaml.tpl into the
# .yaml file
mkdir -p ${BUILDDIR}/webhook/base/deploy
+ curl -sL ${KATA_WEBHOOK_URL}/common.bash -o ${BUILDDIR}/webhook/base/common.bash
curl -sL ${KATA_WEBHOOK_URL}/create-certs.sh -o ${BUILDDIR}/webhook/base/create-certs.sh
curl -sL ${KATA_WEBHOOK_URL}/deploy/webhook-registration.yaml.tpl -o ${BUILDDIR}/webhook/base/deploy/webhook-registration.yaml.tpl
curl -sL ${KATA_WEBHOOK_URL}/deploy/webhook.yaml -o ${BUILDDIR}/webhook/base/deploy/webhook.yaml
curl -sL ${KATA_WEBHOOK_URL}/create-certs.sh -o ${BUILDDIR}/webhook/base/create-certs.sh
curl -sL ${KATA_WEBHOOK_URL}/deploy/webhook-registration.yaml.tpl -o ${BUILDDIR}/webhook/base/deploy/webhook-registration.yaml.tpl
curl -sL ${KATA_WEBHOOK_URL}/deploy/webhook.yaml -o ${BUILDDIR}/webhook/base/deploy/webhook.yaml
@@
-64,17
+63,27
@@
function clean_webhook {
kustomize build ${BUILDDIR}/webhook/base | KUBECONFIG=${cluster_kubeconfig} kubectl delete -f -
}
kustomize build ${BUILDDIR}/webhook/base | KUBECONFIG=${cluster_kubeconfig} kubectl delete -f -
}
+function is_kata_deployed {
+ local -r cluster_name=${CLUSTER_NAME:-icn}
+ 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
function test_kata {
# Create a temporary kubeconfig file for the tests
- local -r cluster_name=${CLUSTER_NAME:-
e2etest
}
+ local -r cluster_name=${CLUSTER_NAME:-
icn
}
local -r cluster_kubeconfig="${BUILDDIR}/${cluster_name}.conf"
clusterctl -n metal3 get kubeconfig ${cluster_name} >${cluster_kubeconfig}
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_TRIES=30
+ wait_for is_kata_deployed
+
deploy_webhook ${cluster_name}
clone_kud_repository
pushd ${KUDPATH}/kud/tests
failed_kud_tests=""
deploy_webhook ${cluster_name}
clone_kud_repository
pushd ${KUDPATH}/kud/tests
failed_kud_tests=""
- KUBECONFIG=${cluster_kubeconfig} bash kata.sh || failed_kud_tests="${failed_kud_tests}
${test}
"
+ KUBECONFIG=${cluster_kubeconfig} bash kata.sh || failed_kud_tests="${failed_kud_tests}
kata
"
popd
clean_webhook ${cluster_name}
if [[ ! -z "$failed_kud_tests" ]]; then
popd
clean_webhook ${cluster_name}
if [[ ! -z "$failed_kud_tests" ]]; then
@@
-93,7
+102,7
@@
case $1 in
Usage: $(basename $0) COMMAND
The "test" command looks for the CLUSTER_NAME variable in the
Usage: $(basename $0) COMMAND
The "test" command looks for the CLUSTER_NAME variable in the
-environment (default: "
e2etest
"). This should be the name of the
+environment (default: "
icn
"). This should be the name of the
Cluster resource to execute the tests in.
Commands:
Cluster resource to execute the tests in.
Commands: