From 14533569a1b15fd78170bf0209c9775fdd5fd2cd Mon Sep 17 00:00:00 2001
From: Andri Joos <andri@joos.io>
Date: Mon, 3 Mar 2025 17:28:05 +0100
Subject: [PATCH] fixup! add distribution.create_cluster

---
 distribution.create_cluster.sh | 18 +++++++-----------
 helpers/helm_helpers.sh        |  4 ++--
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/distribution.create_cluster.sh b/distribution.create_cluster.sh
index 8a27497..7d2e207 100644
--- a/distribution.create_cluster.sh
+++ b/distribution.create_cluster.sh
@@ -32,18 +32,14 @@ install_helm_chart calico \
     5m \
     "${calico_dir}/values.yaml" \
     "--set installation.calicoNetwork.ipPools[0].cidr=${CLUSTER_CIDR}"
-# helm repo add ${calico_repo_name} https://docs.tigera.io/calico/charts
-# helm repo update
-# helm upgrade calico ${calico_repo_name}/tigera-operator \
-#     --install \
-#     --version "${CALICO_VERSION:-v3.29.2}" \
-#     --namespace tigera-operator \
-#     --create-namespace \
-#     --values "${calico_dir}/values.yaml" \
-#     --wait \
-#     --set "installation.calicoNetwork.ipPools[0].cidr=${CLUSTER_CIDR}"
 
-helm repo remove ${calico_repo_name}
+remove_helm_repo ${calico_repo_name}
 rm -rf "${calico_dir}"
 
 # install gitlab agent
+install_gitlab_agent \
+    "${GITLAB_AGENT_CHART_VERSION:-2.7.2}" \
+    "https://git.420joos.dev/kubernetes-cluster/gitlab/runners/kubernetes-agent.git" \
+    "values.yaml" \
+    "${GITLAB_AGENT_IMAGE_VERSION:-17.4.1}" \
+    "${GITLAB_AGENT_TOKEN}"
diff --git a/helpers/helm_helpers.sh b/helpers/helm_helpers.sh
index 45cd830..270e206 100644
--- a/helpers/helm_helpers.sh
+++ b/helpers/helm_helpers.sh
@@ -42,7 +42,7 @@ install_gitlab_agent() {
     chart_version=$1
     git_repo_url=$2
     values_filenames=$3
-    image_tag=$4
+    image_version=$4
     token=$5
     
     git_repo_dir="/tmp/gitlab-agent"
@@ -51,7 +51,7 @@ install_gitlab_agent() {
         values_files="${values_files} ${git_repo_dir}/${filename}"
     done
 
-    upgrade_args="--set image.tag=${image_tag} --set config.token=${token}"
+    upgrade_args="--set image.tag=v${image_version} --set config.token=${token}"
 
     git clone "${git_repo_url}" "${git_repo_dir}"
 
-- 
GitLab