Skip to content

Commit

Permalink
chore: rename of types
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gosteli <[email protected]>
  • Loading branch information
ghouscht committed Nov 29, 2024
1 parent 38f064d commit 1c802e1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func Test_OriginatorSupplier(t *testing.T) {
{
name: "from terraform lock",
input: pkg.Package{
Metadata: pkg.TerraformLockEntry{},
Metadata: pkg.TerraformLockProviderEntry{},
},
originator: "",
supplier: "",
Expand Down
2 changes: 1 addition & 1 deletion syft/internal/packagemetadata/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func AllTypes() []any {
pkg.RustCargoLockEntry{},
pkg.SwiftPackageManagerResolvedEntry{},
pkg.SwiplPackEntry{},
pkg.TerraformLockEntry{},
pkg.TerraformLockProviderEntry{},
pkg.WordpressPluginEntry{},
pkg.YarnLockEntry{},
}
Expand Down
2 changes: 1 addition & 1 deletion syft/internal/packagemetadata/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var jsonTypes = makeJSONTypes(
jsonNamesWithoutLookup(pkg.RustBinaryAuditEntry{}, "rust-cargo-audit-entry", "RustCargoPackageMetadata"), // the legacy value is split into two types, where the other is preferred
jsonNames(pkg.WordpressPluginEntry{}, "wordpress-plugin-entry", "WordpressMetadata"),
jsonNames(pkg.LuaRocksPackage{}, "luarocks-package"),
jsonNames(pkg.TerraformLockEntry{}, "terraform-lock-entry"),
jsonNames(pkg.TerraformLockProviderEntry{}, "terraform-lock-provider-entry"),
)

func expandLegacyNameVariants(names ...string) []string {
Expand Down
4 changes: 2 additions & 2 deletions syft/pkg/cataloger/terraform/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestTerraformCataloger(t *testing.T) {
Type: pkg.TerraformPkg,
Language: pkg.Go,
PURL: "pkg:terraform/registry.terraform.io/hashicorp/[email protected]",
Metadata: pkg.TerraformLockEntry{
Metadata: pkg.TerraformLockProviderEntry{
URL: "registry.terraform.io/hashicorp/aws",
Version: "5.72.1",
Constraints: "> 5.72.0",
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestTerraformCataloger(t *testing.T) {
Type: pkg.TerraformPkg,
Language: pkg.Go,
PURL: "pkg:terraform/registry.terraform.io/hashicorp/[email protected]",
Metadata: pkg.TerraformLockEntry{
Metadata: pkg.TerraformLockProviderEntry{
URL: "registry.terraform.io/hashicorp/google",
Version: "6.8.0",
Constraints: "6.8.0",
Expand Down
2 changes: 1 addition & 1 deletion syft/pkg/cataloger/terraform/parse_tf_lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

type terraformLockFile struct {
Providers []pkg.TerraformLockEntry `hcl:"provider,block"`
Providers []pkg.TerraformLockProviderEntry `hcl:"provider,block"`
}

func parseTerraformLock(_ context.Context, _ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
Expand Down
4 changes: 2 additions & 2 deletions syft/pkg/terraform.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package pkg

// TerraformLockEntry represents a single entry in a Terraform dependency lock file (.terraform.lock.hcl).
type TerraformLockEntry struct {
// 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"`
Version string `hcl:"version" json:"version"`
Expand Down

0 comments on commit 1c802e1

Please sign in to comment.