From e5e94e03d3cc7928e6842be0bcdea3a7b2fba341 Mon Sep 17 00:00:00 2001 From: Zsombor Fedor Date: Wed, 5 Feb 2025 15:06:00 +0100 Subject: [PATCH] License file date checks License files issued the same day or expired the same day as the current date were not accepted. Changed < to <= and > to >= in the comparisons. --- setup/terraform/lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/terraform/lib/common.sh b/setup/terraform/lib/common.sh index 3cb60a1..bf050b9 100644 --- a/setup/terraform/lib/common.sh +++ b/setup/terraform/lib/common.sh @@ -481,8 +481,8 @@ function validate_license() { (license_metadata | jq . > /dev/null) && \ [[ ! -z $(license_metadata | jq -r .name) ]] && \ [[ ! -z $(license_metadata | jq -r .uuid) ]] && \ - [[ ! -z $(license_metadata | jq -r .startDate) && $(license_metadata | jq -r .startDate) < "$(date +%Y-%m-%d)" ]] && \ - [[ ! -z $(license_metadata | jq -r .expirationDate) && $(license_metadata | jq -r .expirationDate) > "$(date +%Y-%m-%d)" ]] && \ + [[ ! -z $(license_metadata | jq -r .startDate) && $(license_metadata | jq -r .startDate) -le "$(date +%Y-%m-%d)" ]] && \ + [[ ! -z $(license_metadata | jq -r .expirationDate) && $(license_metadata | jq -r .expirationDate) -ge "$(date +%Y-%m-%d)" ]] && \ return echo "${C_RED}ERROR: The license in file "\""${TF_VAR_cdp_license_file_original}"\"" is either invalid or expired.${C_NORMAL}"