File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
config/common/group_vars/all Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,13 @@ check_tools() {
145145 fi
146146}
147147
148+ # Retrieve version from git
149+ get_repo_version () {
150+ pushd " ${root_path} " > /dev/null || exit 1
151+ git describe --exact-match --tags 2> /dev/null || git rev-parse HEAD
152+ popd > /dev/null || exit 1
153+ }
154+
148155validate_sops_config () {
149156 if [ ! -f " ${sops_config} " ]; then
150157 log_error " ERROR: SOPS config not found: ${sops_config} "
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ cp -r "${config_defaults_path}/common/group_vars" "${config_path}/"
6161
6262cp -r --dereference " ${config_defaults_path} /${flavor} /group_vars" " ${config_path} /"
6363
64+ # Set ck8sKubesprayVersion to be the current repo version
65+ CK8S_KUBESPRAY_VERSION=$( get_repo_version)
66+ export CK8S_KUBESPRAY_VERSION
67+ yq -i " .ck8sKubesprayVersion = \" ${CK8S_KUBESPRAY_VERSION} \" " " ${CK8S_CONFIG_PATH} /${prefix} -config/group_vars/all/ck8s-kubespray-general.yaml"
68+
6469# Copy inventory.ini
6570if [[ ! -f " ${config[inventory_file]} " ]]; then
6671 PREFIX=${prefix} envsubst > " ${config[inventory_file]} " < " ${config_defaults_path} /inventory.ini"
Original file line number Diff line number Diff line change 1- ck8sKubesprayVersion : v2.27.0-ck8s1
1+ ck8sKubesprayVersion : run-init-to-set
22control_plane_label : node-role.kubernetes.io/control-plane
33group_label_primary : elastisys.io/node-type
44group_label_secondary : elastisys.io/ams-cluster-name
You can’t perform that action at this time.
0 commit comments