diff --git a/tools/terraform-bundle/e2etest/package_test.go b/tools/terraform-bundle/e2etest/package_test.go index 08ea378d2..6331fe99f 100644 --- a/tools/terraform-bundle/e2etest/package_test.go +++ b/tools/terraform-bundle/e2etest/package_test.go @@ -125,6 +125,9 @@ func TestPackage_manyProviders(t *testing.T) { for _, file := range read.File { if _, exists := expectedFiles[file.Name]; exists { + if !file.FileInfo().Mode().IsRegular() { + t.Errorf("Expected file is not a regular file: %s", file.Name) + } delete(expectedFiles, file.Name) } else { extraFiles[file.Name] = struct{}{} @@ -195,6 +198,9 @@ func TestPackage_localProviders(t *testing.T) { for _, file := range read.File { if _, exists := expectedFiles[file.Name]; exists { + if !file.FileInfo().Mode().IsRegular() { + t.Errorf("Expected file is not a regular file: %s", file.Name) + } delete(expectedFiles, file.Name) } else { extraFiles[file.Name] = struct{}{} diff --git a/tools/terraform-bundle/package.go b/tools/terraform-bundle/package.go index 60b217db8..3a6de2b7b 100644 --- a/tools/terraform-bundle/package.go +++ b/tools/terraform-bundle/package.go @@ -226,7 +226,7 @@ func (c *PackageCommand) Run(args []string) int { return addZipFile( filepath.Join(linkPath, file.Name()), // the link to this provider binary filepath.Join(relPath, file.Name()), // the expected directory for the binary - info, outZ, + file, outZ, ) } }