-
-
Notifications
You must be signed in to change notification settings - Fork 577
Open
Labels
Description
With introduction of mode support to terraform_providers_lock hooks it should be possible to run the hook without terraform_validate when mode=only-check-is-current-lockfile-cross-platform, but it is not working as advertised.
It works as advertised only when lockfile_contains_all_needed_sha returns 0 = when the lock file is valid. If it NOT valid, for example it is missing hash for some platform, the condition
| lockfile_contains_all_needed_sha "$platforms_count"; then |
terraform providers lock on line | "$tf_path" providers lock "${args[@]}" |
IMHO the condition could be rewritten to:
if [ "$mode" == "only-check-is-current-lockfile-cross-platform" ] ; then
lockfile_contains_all_needed_sha "$platforms_count"
exit_code=$?
return $exit_code
fi
In this case it could be executed in mode=only-check-is-current-lockfile-cross-platform without running terraform_validate which runs terraform init under the hood.