Skip to content

Commit

Permalink
Removed unused code and formatted
Browse files Browse the repository at this point in the history
Signed-off-by: Domenico Luciani <dluciani@vmware.com>
  • Loading branch information
Domenico Luciani committed Sep 20, 2023
1 parent 8ff6c79 commit 61f276c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 44 deletions.
2 changes: 0 additions & 2 deletions internal/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ const (
workspaceDir = "/workspace"
layersDir = "/layers"

emptyTarDiffID = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

metadataLabel = "io.buildpacks.builder.metadata"
stackLabel = "io.buildpacks.stack.id"

Expand Down
3 changes: 2 additions & 1 deletion internal/commands/builder_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/buildpack_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 3 additions & 8 deletions pkg/buildpack/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand All @@ -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 {
Expand Down
32 changes: 0 additions & 32 deletions pkg/buildpack/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 61f276c

Please sign in to comment.