From 1f3b9b13eca8dcdc6f695ef85a66d7e7eb683fb8 Mon Sep 17 00:00:00 2001 From: HughNhan Date: Tue, 26 Mar 2024 21:22:50 -0400 Subject: [PATCH] add user-project option --- endpoints/k8s/k8s | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/endpoints/k8s/k8s b/endpoints/k8s/k8s index 1713b4e1..dbc8e5d9 100755 --- a/endpoints/k8s/k8s +++ b/endpoints/k8s/k8s @@ -56,6 +56,7 @@ pod_prefix="rickshaw" project_name="crucible-rickshaw" hypervisor_host="none" unique_project="0" +user_project="" hostNetwork="0" hugepage="0" osruntime[default]="pod" @@ -421,8 +422,14 @@ function process_k8s_opts() { val=`echo $opt | sed -e s/^$arg://` case "$arg" in unique-project) + # This option auto-generates a project name. CLI option '--unique-project=1' unique_project=${val} ;; + user-project) + # This option allows a user-defined project name. CLI option '--user-project=my-k8s-project' + # unique-project option has higher precedence. + user_project=${val} + ;; kubeconfig) kubeconfig=$val ;; @@ -517,6 +524,8 @@ function process_k8s_opts() { if [ "${unique_project}" == "1" ]; then project_name+="--${run_id}-${endpoint_label}" + elif [ ! -z "${user_project}" ]; then + project_name="${user_project}" fi }