Skip to content

Commit 360dbae

Browse files
authored
Merge pull request #1187 from aemengo/fix-lifecycle-0.11.3-package-renames
Bump to lifecycle v0.11.3 Signed-off-by: David Freilich <[email protected]>
2 parents eb72b8a + 2fd4158 commit 360dbae

33 files changed

+879
-1028
lines changed

acceptance/testdata/pack_fixtures/report_output.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pack:
22
Version: {{ .Version }}
33
OS/Arch: {{ .OS }}/{{ .Arch }}
44

5-
Default Lifecycle Version: 0.10.2
5+
Default Lifecycle Version: 0.11.3
66

77
Supported Platform APIs: 0.3, 0.4
88

build_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ func testBuild(t *testing.T, when spec.G, it spec.S) {
16021602
h.AssertEq(t, args.Daemon, true)
16031603
h.AssertEq(t, args.PullPolicy, config.PullNever)
16041604

1605-
args = fakeImageFetcher.FetchCalls["buildpacksio/lifecycle:0.10.2"]
1605+
args = fakeImageFetcher.FetchCalls["buildpacksio/lifecycle:0.11.3"]
16061606
h.AssertEq(t, args.Daemon, true)
16071607
h.AssertEq(t, args.PullPolicy, config.PullNever)
16081608
})

client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type Downloader interface {
5151
type ImageFactory interface {
5252
// NewImage initializes an image object with required settings so that it
5353
// can be written either locally or to a registry.
54-
NewImage(repoName string, local bool) (imgutil.Image, error)
54+
NewImage(repoName string, local bool, imageOS string) (imgutil.Image, error)
5555
}
5656

5757
// Client is an orchestration object, it contains all parameters needed to

create_builder_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func testCreateBuilder(t *testing.T, when spec.G, it spec.S) {
170170

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

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

906906
bpd := dist.BuildpackDescriptor{
907907
API: api.MustParse("0.3"),

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ require (
55
github.com/Masterminds/semver v1.5.0
66
github.com/Microsoft/hcsshim v0.8.10 // indirect
77
github.com/apex/log v1.9.0
8-
github.com/buildpacks/imgutil v0.0.0-20210209163614-30601e371ce3
9-
github.com/buildpacks/lifecycle v0.10.2
8+
github.com/buildpacks/imgutil v0.0.0-20210510154637-009f91f52918
9+
github.com/buildpacks/lifecycle v0.11.3
1010
github.com/containerd/containerd v1.4.1 // indirect
1111
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 // indirect
1212
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible

go.sum

+13-160
Large diffs are not rendered by default.

inspect_image.go

+12-11
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"strings"
66

77
"github.com/Masterminds/semver"
8-
"github.com/buildpacks/lifecycle"
8+
"github.com/buildpacks/lifecycle/buildpack"
99
"github.com/buildpacks/lifecycle/launch"
10+
"github.com/buildpacks/lifecycle/platform"
1011
"github.com/pkg/errors"
1112

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

2324
// List of buildpacks that passed detection, ran their build
2425
// phases and made a contribution to this image.
25-
Buildpacks []lifecycle.GroupBuildpack
26+
Buildpacks []buildpack.GroupBuildpack
2627

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

4344
// BOM or Bill of materials, contains dependency and
4445
// version information provided by each buildpack.
45-
BOM []lifecycle.BOMEntry
46+
BOM []buildpack.BOMEntry
4647

4748
// Stack includes the run image name, and a list of image mirrors,
4849
// where the run image is hosted.
49-
Stack lifecycle.StackMetadata
50+
Stack platform.StackMetadata
5051

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

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

7172
const (
@@ -94,12 +95,12 @@ func (c *Client) InspectImage(name string, daemon bool) (*ImageInfo, error) {
9495
}
9596

9697
var layersMd layersMetadata
97-
if _, err := dist.GetLabel(img, lifecycle.LayerMetadataLabel, &layersMd); err != nil {
98+
if _, err := dist.GetLabel(img, platform.LayerMetadataLabel, &layersMd); err != nil {
9899
return nil, err
99100
}
100101

101-
var buildMD lifecycle.BuildMetadata
102-
if _, err := dist.GetLabel(img, lifecycle.BuildMetadataLabel, &buildMD); err != nil {
102+
var buildMD platform.BuildMetadata
103+
if _, err := dist.GetLabel(img, platform.BuildMetadataLabel, &buildMD); err != nil {
103104
return nil, err
104105
}
105106

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

113-
stackID, err := img.Label(lifecycle.StackIDLabel)
114+
stackID, err := img.Label(platform.StackIDLabel)
114115
if err != nil {
115116
return nil, err
116117
}

inspect_image_test.go

+7-9
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ import (
77
"fmt"
88
"testing"
99

10-
"github.com/buildpacks/pack/internal/logging"
11-
12-
"github.com/buildpacks/pack/config"
13-
1410
"github.com/buildpacks/imgutil/fakes"
15-
"github.com/buildpacks/lifecycle"
1611
"github.com/buildpacks/lifecycle/launch"
12+
"github.com/buildpacks/lifecycle/platform"
1713
"github.com/golang/mock/gomock"
1814
"github.com/heroku/color"
1915
"github.com/sclevine/spec"
2016
"github.com/sclevine/spec/report"
2117

18+
"github.com/buildpacks/pack/config"
2219
"github.com/buildpacks/pack/internal/image"
20+
"github.com/buildpacks/pack/internal/logging"
2321
h "github.com/buildpacks/pack/testhelpers"
2422
"github.com/buildpacks/pack/testmocks"
2523
)
@@ -134,8 +132,8 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
134132
info, err := subject.InspectImage("some/image", useDaemon)
135133
h.AssertNil(t, err)
136134
h.AssertEq(t, info.Stack,
137-
lifecycle.StackMetadata{
138-
RunImage: lifecycle.StackRunImageMetadata{
135+
platform.StackMetadata{
136+
RunImage: platform.StackRunImageMetadata{
139137
Image: "some-run-image",
140138
Mirrors: []string{
141139
"some-mirror",
@@ -150,7 +148,7 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
150148
info, err := subject.InspectImage("some/image", useDaemon)
151149
h.AssertNil(t, err)
152150
h.AssertEq(t, info.Base,
153-
lifecycle.RunImageMetadata{
151+
platform.RunImageMetadata{
154152
TopLayer: "some-top-layer",
155153
Reference: "some-run-image-reference",
156154
},
@@ -617,7 +615,7 @@ func testInspectImage(t *testing.T, when spec.G, it spec.S) {
617615
info, err := subject.InspectImage("old/image", true)
618616
h.AssertNil(t, err)
619617
h.AssertEq(t, info.Base,
620-
lifecycle.RunImageMetadata{
618+
platform.RunImageMetadata{
621619
TopLayer: "some-top-layer",
622620
Reference: "",
623621
},

internal/builder/lifecycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// A snapshot of the latest tested lifecycle version values
1616
const (
17-
DefaultLifecycleVersion = "0.10.2"
17+
DefaultLifecycleVersion = "0.11.3"
1818
DefaultBuildpackAPIVersion = "0.2"
1919
)
2020

internal/builder/testmocks/mock_lifecycle.go

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)