fix(terraform): parse provider lock entries without constraints (#3934)

In a .terraform.lock.hcl file in a provider block the `constraints` attribute is actually not required (=optional).

Signed-off-by: Thomas Gosteli <thomas.gosteli@protonmail.ch>
This commit is contained in:
Thomas Gosteli
2025-05-27 14:55:19 -04:00
committed by GitHub
parent bbf3bb5856
commit 684e1e963d
3 changed files with 2 additions and 3 deletions
@@ -59,7 +59,7 @@ func TestTerraformCataloger(t *testing.T) {
Metadata: pkg.TerraformLockProviderEntry{
URL: "registry.terraform.io/hashicorp/google",
Version: "6.8.0",
Constraints: "6.8.0",
Constraints: "",
Hashes: []string{
"h1:GlCaVPk6eKMg2ZbRY7C5tUeHGNIABT+qFtMl8+XWZHM=",
"zh:1b78f4451f1617092eb6891c9c13eda79671060601c40947feea6794c732157a",
@@ -26,7 +26,6 @@ provider "registry.terraform.io/hashicorp/aws" {
provider "registry.terraform.io/hashicorp/google" {
version = "6.8.0"
constraints = "6.8.0"
hashes = [
"h1:GlCaVPk6eKMg2ZbRY7C5tUeHGNIABT+qFtMl8+XWZHM=",
"zh:1b78f4451f1617092eb6891c9c13eda79671060601c40947feea6794c732157a",