Skip to content

Commit

Permalink
fix builder
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdarshankumar committed Mar 6, 2023
1 parent b6232c7 commit 271f4d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion internal/commands/extension_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func ExtensionPackage(logger logging.Logger, cfg config.Config, packager Extensi
action = "published"
}

logger.Infof("Successfully %s package %s", action, style.Symbol(name))
logger.Infof("Successfully %s package %s", action, style.Symbol(name))
return nil
}),
Expand Down
12 changes: 8 additions & 4 deletions pkg/buildpack/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package buildpack
import (
"archive/tar"
"compress/gzip"
"fmt"
"io"
"os"

Expand Down Expand Up @@ -151,7 +150,7 @@ func (b *PackageBuilder) finalizeExtensionImage(image WorkableImage, tmpDir stri

dist.AddToLayersMD(exLayers, b.extension.Descriptor(), diffID.String())

if err := dist.SetLabel(image, dist.BuildpackLayersLabel, exLayers); err != nil {
if err := dist.SetLabel(image, dist.ExtensionLayersLabel, exLayers); err != nil {
return err
}

Expand Down Expand Up @@ -279,8 +278,14 @@ func (b *PackageBuilder) SaveAsImage(repoName string, publish bool, imageOS stri
if err != nil {
return nil, errors.Wrapf(err, "creating image")
}
tempDirName := ""
if b.buildpack != nil {
tempDirName = "package-buildpack"
} else {
tempDirName = "extension-buildpack"
}

tmpDir, err := os.MkdirTemp("", "package-buildpack")
tmpDir, err := os.MkdirTemp("", tempDirName)
if err != nil {
return nil, err
}
Expand All @@ -294,7 +299,6 @@ func (b *PackageBuilder) SaveAsImage(repoName string, publish bool, imageOS stri
return nil, err
}
}
fmt.Println("Successfully created package", image)

if err := image.Save(); err != nil {
return nil, err
Expand Down

0 comments on commit 271f4d8

Please sign in to comment.