Skip to content

Commit

Permalink
Merge pull request #1187 from aemengo/fix-lifecycle-0.11.3-package-re…
Browse files Browse the repository at this point in the history
…names

Bump to lifecycle v0.11.3
Signed-off-by: David Freilich <freilich.david@gmail.com>
  • Loading branch information
dfreilich authored May 26, 2021
2 parents eb72b8a + 2fd4158 commit 360dbae
Show file tree
Hide file tree
Showing 33 changed files with 879 additions and 1,028 deletions.
2 changes: 1 addition & 1 deletion acceptance/testdata/pack_fixtures/report_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pack:
Version: {{ .Version }}
OS/Arch: {{ .OS }}/{{ .Arch }}

Default Lifecycle Version: 0.10.2
Default Lifecycle Version: 0.11.3

Supported Platform APIs: 0.3, 0.4

Expand Down
2 changes: 1 addition & 1 deletion build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ func testBuild(t *testing.T, when spec.G, it spec.S) {
h.AssertEq(t, args.Daemon, true)
h.AssertEq(t, args.PullPolicy, config.PullNever)

args = fakeImageFetcher.FetchCalls["buildpacksio/lifecycle:0.10.2"]
args = fakeImageFetcher.FetchCalls["buildpacksio/lifecycle:0.11.3"]
h.AssertEq(t, args.Daemon, true)
h.AssertEq(t, args.PullPolicy, config.PullNever)
})
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Downloader interface {
type ImageFactory interface {
// NewImage initializes an image object with required settings so that it
// can be written either locally or to a registry.
NewImage(repoName string, local bool) (imgutil.Image, error)
NewImage(repoName string, local bool, imageOS string) (imgutil.Image, error)
}

// Client is an orchestration object, it contains all parameters needed to
Expand Down
4 changes: 2 additions & 2 deletions create_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func testCreateBuilder(t *testing.T, when spec.G, it spec.S) {

var createPackage = func(imageName string) *fakes.Image {
packageImage := fakes.NewImage(imageName, "", nil)
mockImageFactory.EXPECT().NewImage(packageImage.Name(), false).Return(packageImage, nil)
mockImageFactory.EXPECT().NewImage(packageImage.Name(), false, "linux").Return(packageImage, nil)

h.AssertNil(t, subject.PackageBuildpack(context.TODO(), pack.PackageBuildpackOptions{
Name: packageImage.Name(),
Expand Down Expand Up @@ -901,7 +901,7 @@ func testCreateBuilder(t *testing.T, when spec.G, it spec.S) {
when("package image lives in docker registry", func() {
it.Before(func() {
packageImage = fakes.NewImage("docker.io/some/package-"+h.RandString(12), "", nil)
mockImageFactory.EXPECT().NewImage(packageImage.Name(), false).Return(packageImage, nil)
mockImageFactory.EXPECT().NewImage(packageImage.Name(), false, "linux").Return(packageImage, nil)

bpd := dist.BuildpackDescriptor{
API: api.MustParse("0.3"),
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/Microsoft/hcsshim v0.8.10 // indirect
github.com/apex/log v1.9.0
github.com/buildpacks/imgutil v0.0.0-20210209163614-30601e371ce3
github.com/buildpacks/lifecycle v0.10.2
github.com/buildpacks/imgutil v0.0.0-20210510154637-009f91f52918
github.com/buildpacks/lifecycle v0.11.3
github.com/containerd/containerd v1.4.1 // indirect
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 // indirect
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible
Expand Down
173 changes: 13 additions & 160 deletions go.sum

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions inspect_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"strings"

"github.com/Masterminds/semver"
"github.com/buildpacks/lifecycle"
"github.com/buildpacks/lifecycle/buildpack"
"github.com/buildpacks/lifecycle/launch"
"github.com/buildpacks/lifecycle/platform"
"github.com/pkg/errors"

"github.com/buildpacks/pack/config"
Expand All @@ -22,7 +23,7 @@ type ImageInfo struct {

// List of buildpacks that passed detection, ran their build
// phases and made a contribution to this image.
Buildpacks []lifecycle.GroupBuildpack
Buildpacks []buildpack.GroupBuildpack

// Base includes two references to the run image,
// - the Run Image ID,
Expand All @@ -38,15 +39,15 @@ type ImageInfo struct {
// the first 1 to k layers all belong to the run image,
// the last k+1 to n layers are added by buildpacks.
// the sum of all of these is our app image.
Base lifecycle.RunImageMetadata
Base platform.RunImageMetadata

// BOM or Bill of materials, contains dependency and
// version information provided by each buildpack.
BOM []lifecycle.BOMEntry
BOM []buildpack.BOMEntry

// Stack includes the run image name, and a list of image mirrors,
// where the run image is hosted.
Stack lifecycle.StackMetadata
Stack platform.StackMetadata

// Processes lists all processes contributed by buildpacks.
Processes ProcessDetails
Expand All @@ -64,8 +65,8 @@ type ProcessDetails struct {

// Deserialize just the subset of fields we need to avoid breaking changes
type layersMetadata struct {
RunImage lifecycle.RunImageMetadata `json:"runImage" toml:"run-image"`
Stack lifecycle.StackMetadata `json:"stack" toml:"stack"`
RunImage platform.RunImageMetadata `json:"runImage" toml:"run-image"`
Stack platform.StackMetadata `json:"stack" toml:"stack"`
}

const (
Expand Down Expand Up @@ -94,12 +95,12 @@ func (c *Client) InspectImage(name string, daemon bool) (*ImageInfo, error) {
}

var layersMd layersMetadata
if _, err := dist.GetLabel(img, lifecycle.LayerMetadataLabel, &layersMd); err != nil {
if _, err := dist.GetLabel(img, platform.LayerMetadataLabel, &layersMd); err != nil {
return nil, err
}

var buildMD lifecycle.BuildMetadata
if _, err := dist.GetLabel(img, lifecycle.BuildMetadataLabel, &buildMD); err != nil {
var buildMD platform.BuildMetadata
if _, err := dist.GetLabel(img, platform.BuildMetadataLabel, &buildMD); err != nil {
return nil, err
}

Expand All @@ -110,7 +111,7 @@ func (c *Client) InspectImage(name string, daemon bool) (*ImageInfo, error) {
layersMd.RunImage.Reference = ""
}

stackID, err := img.Label(lifecycle.StackIDLabel)
stackID, err := img.Label(platform.StackIDLabel)
if err != nil {
return nil, err
}
Expand Down
16 changes: 7 additions & 9 deletions inspect_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ import (
"fmt"
"testing"

"github.com/buildpacks/pack/internal/logging"

"github.com/buildpacks/pack/config"

"github.com/buildpacks/imgutil/fakes"
"github.com/buildpacks/lifecycle"
"github.com/buildpacks/lifecycle/launch"
"github.com/buildpacks/lifecycle/platform"
"github.com/golang/mock/gomock"
"github.com/heroku/color"
"github.com/sclevine/spec"
"github.com/sclevine/spec/report"

"github.com/buildpacks/pack/config"
"github.com/buildpacks/pack/internal/image"
"github.com/buildpacks/pack/internal/logging"
h "github.com/buildpacks/pack/testhelpers"
"github.com/buildpacks/pack/testmocks"
)
Expand Down Expand Up @@ -134,8 +132,8 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
info, err := subject.InspectImage("some/image", useDaemon)
h.AssertNil(t, err)
h.AssertEq(t, info.Stack,
lifecycle.StackMetadata{
RunImage: lifecycle.StackRunImageMetadata{
platform.StackMetadata{
RunImage: platform.StackRunImageMetadata{
Image: "some-run-image",
Mirrors: []string{
"some-mirror",
Expand All @@ -150,7 +148,7 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
info, err := subject.InspectImage("some/image", useDaemon)
h.AssertNil(t, err)
h.AssertEq(t, info.Base,
lifecycle.RunImageMetadata{
platform.RunImageMetadata{
TopLayer: "some-top-layer",
Reference: "some-run-image-reference",
},
Expand Down Expand Up @@ -617,7 +615,7 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
info, err := subject.InspectImage("old/image", true)
h.AssertNil(t, err)
h.AssertEq(t, info.Base,
lifecycle.RunImageMetadata{
platform.RunImageMetadata{
TopLayer: "some-top-layer",
Reference: "",
},
Expand Down
2 changes: 1 addition & 1 deletion internal/builder/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// A snapshot of the latest tested lifecycle version values
const (
DefaultLifecycleVersion = "0.10.2"
DefaultLifecycleVersion = "0.11.3"
DefaultBuildpackAPIVersion = "0.2"
)

Expand Down
16 changes: 8 additions & 8 deletions internal/builder/testmocks/mock_lifecycle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 360dbae

Please sign in to comment.