From e430c276a48ca1d085b8256c0a9ce0c20292a5b7 Mon Sep 17 00:00:00 2001 From: yxxhero Date: Fri, 3 Jun 2022 19:37:03 +0800 Subject: [PATCH] update localtest scripts Signed-off-by: yxxhero --- scripts/harbor_operator_kind.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/harbor_operator_kind.sh b/scripts/harbor_operator_kind.sh index 54b4e1634..610ae5307 100644 --- a/scripts/harbor_operator_kind.sh +++ b/scripts/harbor_operator_kind.sh @@ -40,6 +40,11 @@ Usage: $(basename "$0") start [options] EOF } +set_dev_harbor_operator_image() { + DEFAULT_DEV_HABOR_OPERATOR_IMAGE="${DEFAULT_DEV_HABOR_OPERATOR_IMAGE}_$(date +%s)" + echo "The harbor operator image is set to $DEFAULT_DEV_HABOR_OPERATOR_IMAGE" +} + cacheDir() { local arch=$(uname -m) echo "$RUNNER_TOOL_CACHE/tools/$version/$arch" @@ -309,7 +314,7 @@ install_harbor() { } check_args_number(){ - if [ $# -le 1 ]; then + if [ $# -lt 1 ]; then echo "Usage: $0 start|clean" exit 1 fi @@ -336,6 +341,8 @@ clean(){ main(){ check_docker_installed + check_args_number $@ + set_dev_harbor_operator_image local RUNNER_TOOL_CACHE="$DEFAULT_RUNNER_TOOL_CACHE" local version="$DEFAULT_KIND_VERSION" @@ -346,7 +353,6 @@ main(){ local wait=60s local log_level= - check_args_number $@ case $1 in start) start $@