From a294261b41cd394a2d20e118c700748653b508b5 Mon Sep 17 00:00:00 2001 From: Jon Zeolla Date: Mon, 29 Jul 2024 15:18:36 -0400 Subject: [PATCH] fix: opentofu customization detection logic --- build/docker-entrypoint.sh | 2 +- build/hooks/40-set_default_opentofu_version.sh | 2 +- build/hooks/50-opentofu_dynamic_version_use.sh | 2 +- easy_infra/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/docker-entrypoint.sh b/build/docker-entrypoint.sh index e70dfa4f..2c678e03 100755 --- a/build/docker-entrypoint.sh +++ b/build/docker-entrypoint.sh @@ -69,7 +69,7 @@ elif [ "$#" -eq 0 ]; then echo -e "terraform\t ${TERRAFORM_VERSION}" fi elif [ -x "$(which tofu)" ]; then - current_version=$(cat /home/easy_infra/.tofuenv/version) + current_version=v$(cat /home/easy_infra/.tofuenv/version) if [[ "${OPENTOFU_VERSION}" != "${current_version}" ]]; then echo -e "tofu\t ${OPENTOFU_VERSION} (customized)" else diff --git a/build/hooks/40-set_default_opentofu_version.sh b/build/hooks/40-set_default_opentofu_version.sh index d3aad438..bbf418e4 100755 --- a/build/hooks/40-set_default_opentofu_version.sh +++ b/build/hooks/40-set_default_opentofu_version.sh @@ -6,7 +6,7 @@ source /usr/local/bin/common.sh -current_version=$(cat /home/easy_infra/.tofuenv/version) +current_version=v$(cat /home/easy_infra/.tofuenv/version) output_log="/var/log/$(basename "${BASH_SOURCE[0]%%.sh}.log")" if [[ -z "${OPENTOFU_VERSION}" ]]; then diff --git a/build/hooks/50-opentofu_dynamic_version_use.sh b/build/hooks/50-opentofu_dynamic_version_use.sh index 0b59ec3b..ed6b6f02 100755 --- a/build/hooks/50-opentofu_dynamic_version_use.sh +++ b/build/hooks/50-opentofu_dynamic_version_use.sh @@ -13,7 +13,7 @@ if [[ "${AUTODETECT}" != "true" ]]; then exit 0 fi -current_version=$(cat /home/easy_infra/.tofuenv/version) +current_version=v$(cat /home/easy_infra/.tofuenv/version) # Use tofuenv to get the minimum version of opentofu specified in the opentofu code (in the current directory) opentofu_min_required="$(tofuenv min-required 2>>"${output_log}")" diff --git a/easy_infra/__init__.py b/easy_infra/__init__.py index a8ba09c2..a40b72a7 100644 --- a/easy_infra/__init__.py +++ b/easy_infra/__init__.py @@ -3,6 +3,6 @@ """ __maintainer__ = "Seiso" -__copyright__ = "(c) 2022 Seiso, LLC" +__copyright__ = "(c) 2020-2024 Seiso, LLC" __project_name__ = "easy_infra" __version__ = "2024.07.03"