mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
ci: Add first letter of the K8S_TEST_HOST_TYPE to resource group name
Ideally we'd add the instance_type or the full K8S_TEST_HOST_TYPE but that exceeds the maximum amount of characteres allowed for the cluster name. With this in mind, let's use the first letter of K8S_TEST_HOST_TYPE instead. Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
parent
68267a3996
commit
d9ef1352af
@ -13,11 +13,25 @@ source "${tests_dir}/common.bash"
|
|||||||
|
|
||||||
K8S_TEST_HOST_TYPE="${K8S_TEST_HOST_TYPE:-small}"
|
K8S_TEST_HOST_TYPE="${K8S_TEST_HOST_TYPE:-small}"
|
||||||
|
|
||||||
|
function _print_instance_type() {
|
||||||
|
case ${K8S_TEST_HOST_TYPE} in
|
||||||
|
small)
|
||||||
|
echo "Standard_D2s_v5"
|
||||||
|
;;
|
||||||
|
normal)
|
||||||
|
echo "Standard_D4s_v5"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown instance type '${K8S_TEST_HOST_TYPE}'" >&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
function _print_cluster_name() {
|
function _print_cluster_name() {
|
||||||
test_type="${1:-k8s}"
|
test_type="${1:-k8s}"
|
||||||
|
|
||||||
short_sha="$(git rev-parse --short=12 HEAD)"
|
short_sha="$(git rev-parse --short=12 HEAD)"
|
||||||
echo "${test_type}-${GH_PR_NUMBER}-${short_sha}-${KATA_HYPERVISOR}-${KATA_HOST_OS}-amd64"
|
echo "${test_type}-${GH_PR_NUMBER}-${short_sha}-${KATA_HYPERVISOR}-${KATA_HOST_OS}-amd64-${K8S_TEST_HOST_TYPE:0:1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _print_rg_name() {
|
function _print_rg_name() {
|
||||||
@ -52,21 +66,11 @@ function create_cluster() {
|
|||||||
-l eastus2 \
|
-l eastus2 \
|
||||||
-n "${rg}"
|
-n "${rg}"
|
||||||
|
|
||||||
local instance_type=""
|
|
||||||
case ${K8S_TEST_HOST_TYPE} in
|
|
||||||
small)
|
|
||||||
instance_type="Standard_D2s_v5"
|
|
||||||
;;
|
|
||||||
normal)
|
|
||||||
instance_type="Standard_D4s_v5"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
az aks create \
|
az aks create \
|
||||||
-g "${rg}" \
|
-g "${rg}" \
|
||||||
--node-resource-group "node-${rg}" \
|
--node-resource-group "node-${rg}" \
|
||||||
-n "$(_print_cluster_name ${test_type})" \
|
-n "$(_print_cluster_name ${test_type})" \
|
||||||
-s "${instance_type}" \
|
-s "$(_print_instance_type)" \
|
||||||
--node-count 1 \
|
--node-count 1 \
|
||||||
--generate-ssh-keys \
|
--generate-ssh-keys \
|
||||||
$([ "${KATA_HOST_OS}" = "cbl-mariner" ] && echo "--os-sku AzureLinux --workload-runtime KataMshvVmIsolation")
|
$([ "${KATA_HOST_OS}" = "cbl-mariner" ] && echo "--os-sku AzureLinux --workload-runtime KataMshvVmIsolation")
|
||||||
|
Loading…
Reference in New Issue
Block a user