diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 89ffc9845..2602bd27f 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -47,8 +47,6 @@ const ( workspaceDir = "/workspace" layersDir = "/layers" - emptyTarDiffID = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - metadataLabel = "io.buildpacks.builder.metadata" stackLabel = "io.buildpacks.stack.id" diff --git a/internal/commands/builder_create.go b/internal/commands/builder_create.go index 4eb497724..16178cc71 100644 --- a/internal/commands/builder_create.go +++ b/internal/commands/builder_create.go @@ -2,9 +2,10 @@ package commands import ( "fmt" + "path/filepath" + "github.com/pkg/errors" "github.com/spf13/cobra" - "path/filepath" "github.com/buildpacks/pack/builder" "github.com/buildpacks/pack/internal/config" diff --git a/internal/commands/buildpack_package.go b/internal/commands/buildpack_package.go index 0117e5b36..268d4157b 100644 --- a/internal/commands/buildpack_package.go +++ b/internal/commands/buildpack_package.go @@ -2,9 +2,10 @@ package commands import ( "context" + "path/filepath" + "github.com/pkg/errors" "github.com/spf13/cobra" - "path/filepath" pubbldpkg "github.com/buildpacks/pack/buildpackage" "github.com/buildpacks/pack/internal/config" diff --git a/pkg/buildpack/builder.go b/pkg/buildpack/builder.go index c41af1fb5..7236cede0 100644 --- a/pkg/buildpack/builder.go +++ b/pkg/buildpack/builder.go @@ -3,6 +3,9 @@ package buildpack import ( "archive/tar" "compress/gzip" + "io" + "os" + "github.com/buildpacks/imgutil" "github.com/buildpacks/imgutil/layer" v1 "github.com/google/go-containerregistry/pkg/v1" @@ -11,8 +14,6 @@ import ( "github.com/google/go-containerregistry/pkg/v1/mutate" "github.com/google/go-containerregistry/pkg/v1/tarball" "github.com/pkg/errors" - "io" - "os" "github.com/buildpacks/pack/pkg/logging" @@ -35,12 +36,6 @@ type layoutImage struct { v1.Image } -type toAdd struct { - tarPath string - diffID string - module BuildModule -} - func (i *layoutImage) SetLabel(key string, val string) error { configFile, err := i.ConfigFile() if err != nil { diff --git a/pkg/buildpack/buildpack_test.go b/pkg/buildpack/buildpack_test.go index 77f1d2390..7b5756211 100644 --- a/pkg/buildpack/buildpack_test.go +++ b/pkg/buildpack/buildpack_test.go @@ -835,35 +835,3 @@ func assertBuildpacksToTar(t *testing.T, actual []buildpack.ModuleTar, expected h.AssertTrue(t, found) } } - -func assertWindowsBuildpacksToTar(t *testing.T, actual []buildpack.ModuleTar, expected []expectedBuildpack) { - t.Helper() - for _, expectedBP := range expected { - found := false - for _, moduleTar := range actual { - if expectedBP.id == moduleTar.Info().ID && expectedBP.version == moduleTar.Info().Version { - found = true - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s", expectedBP.id), - h.IsDirectory(), - ) - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s/%s", expectedBP.id, expectedBP.version), - h.IsDirectory(), - ) - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s/%s/bin", expectedBP.id, expectedBP.version), - h.IsDirectory(), - ) - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s/%s/bin/build.bat", expectedBP.id, expectedBP.version), - h.HasFileMode(0700), - ) - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s/%s/bin/detect.bat", expectedBP.id, expectedBP.version), - h.HasFileMode(0700), - ) - h.AssertOnTarEntry(t, moduleTar.Path(), fmt.Sprintf("Files/cnb/buildpacks/%s/%s/buildpack.toml", expectedBP.id, expectedBP.version), - h.HasFileMode(0700), - ) - break - } - } - h.AssertTrue(t, found) - } -}