mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
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:
parent
bbf3bb5856
commit
684e1e963d
@ -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",
|
||||
|
||||
@ -3,7 +3,7 @@ package pkg
|
||||
// TerraformLockProviderEntry represents a single provider entry in a Terraform dependency lock file (.terraform.lock.hcl).
|
||||
type TerraformLockProviderEntry struct {
|
||||
URL string `hcl:",label" json:"url"`
|
||||
Constraints string `hcl:"constraints" json:"constraints"`
|
||||
Constraints string `hcl:"constraints,optional" json:"constraints"`
|
||||
Version string `hcl:"version" json:"version"`
|
||||
Hashes []string `hcl:"hashes" json:"hashes"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user