-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into build-config-env
Signed-off-by: Juan Bustamante <[email protected]>
- Loading branch information
Showing
16 changed files
with
139 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
ARG base_image=gcr.io/distroless/static | ||
|
||
FROM golang:1.20 as builder | ||
ARG pack_version | ||
ENV PACK_VERSION=$pack_version | ||
WORKDIR /app | ||
COPY . . | ||
RUN make build | ||
|
||
FROM scratch | ||
FROM ${base_image} | ||
COPY --from=builder /app/out/pack /usr/local/bin/pack | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /tmp /tmp | ||
ENTRYPOINT [ "/usr/local/bin/pack" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,8 +127,12 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
downloadOptions = buildpack.DownloadOptions{ImageOS: "linux"} | ||
) | ||
|
||
shouldFetchPackageImageWith := func(demon bool, pull image.PullPolicy) { | ||
mockImageFetcher.EXPECT().Fetch(gomock.Any(), packageImage.Name(), image.FetchOptions{Daemon: demon, PullPolicy: pull}).Return(packageImage, nil) | ||
shouldFetchPackageImageWith := func(demon bool, pull image.PullPolicy, platform string) { | ||
mockImageFetcher.EXPECT().Fetch(gomock.Any(), packageImage.Name(), image.FetchOptions{ | ||
Daemon: demon, | ||
PullPolicy: pull, | ||
Platform: platform, | ||
}).Return(packageImage, nil) | ||
} | ||
|
||
when("package image lives in cnb registry", func() { | ||
|
@@ -141,11 +145,12 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
downloadOptions = buildpack.DownloadOptions{ | ||
RegistryName: "some-registry", | ||
ImageOS: "linux", | ||
Platform: "linux/amd64", | ||
Daemon: true, | ||
PullPolicy: image.PullAlways, | ||
} | ||
|
||
shouldFetchPackageImageWith(true, image.PullAlways) | ||
shouldFetchPackageImageWith(true, image.PullAlways, "linux/amd64") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "urn:cnb:registry:example/[email protected]", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -161,7 +166,7 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
PullPolicy: image.PullAlways, | ||
} | ||
|
||
shouldFetchPackageImageWith(true, image.PullAlways) | ||
shouldFetchPackageImageWith(true, image.PullAlways, "") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "example/[email protected]", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -185,10 +190,11 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
Daemon: true, | ||
PullPolicy: image.PullAlways, | ||
ImageOS: "linux", | ||
Platform: "linux/amd64", | ||
ImageName: "some/package:tag", | ||
} | ||
|
||
shouldFetchPackageImageWith(true, image.PullAlways) | ||
shouldFetchPackageImageWith(true, image.PullAlways, "linux/amd64") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -204,7 +210,7 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
PullPolicy: image.PullAlways, | ||
} | ||
|
||
shouldFetchPackageImageWith(true, image.PullAlways) | ||
shouldFetchPackageImageWith(true, image.PullAlways, "") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -220,7 +226,7 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
PullPolicy: image.PullAlways, | ||
} | ||
|
||
shouldFetchPackageImageWith(false, image.PullAlways) | ||
shouldFetchPackageImageWith(false, image.PullAlways, "") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -234,7 +240,7 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
Daemon: false, | ||
PullPolicy: image.PullAlways, | ||
} | ||
shouldFetchPackageImageWith(false, image.PullAlways) | ||
shouldFetchPackageImageWith(false, image.PullAlways, "") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), packageImage.Name(), downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
@@ -250,7 +256,7 @@ func testBuildpackDownloader(t *testing.T, when spec.G, it spec.S) { | |
PullPolicy: image.PullNever, | ||
} | ||
|
||
shouldFetchPackageImageWith(false, image.PullNever) | ||
shouldFetchPackageImageWith(false, image.PullNever, "") | ||
mainBP, _, err := buildpackDownloader.Download(context.TODO(), "", downloadOptions) | ||
h.AssertNil(t, err) | ||
h.AssertEq(t, mainBP.Descriptor().Info().ID, "example/foo") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.