Skip to content

Commit

Permalink
Merge branch 'main' into Support-docker-uri-for-lifecycle
Browse files Browse the repository at this point in the history
Signed-off-by: Rashad Sirajudeen <[email protected]>
  • Loading branch information
rashadism authored May 6, 2024
2 parents 80af078 + 32d8db5 commit 18c3a10
Show file tree
Hide file tree
Showing 39 changed files with 915 additions and 562 deletions.
19 changes: 14 additions & 5 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,10 @@ func testAcceptance(
launchCacheVolume.Clear(context.TODO())
})

when("builder is untrusted", func() {
when("there are build image extensions", func() {
it("uses the 5 phases, and runs the extender (build)", func() {
origLifecycle := lifecycle.Image()

output := pack.RunSuccessfully(
"build", repoName,
"-p", filepath.Join("testdata", "mock_app"),
Expand All @@ -846,7 +848,7 @@ func testAcceptance(
assertions.NewOutputAssertionManager(t, output).ReportsSuccessfulImageBuild(repoName)

assertOutput := assertions.NewLifecycleOutputAssertionManager(t, output)
assertOutput.IncludesLifecycleImageTag(lifecycle.Image())
assertOutput.IncludesTagOrEphemeralLifecycle(origLifecycle)
assertOutput.IncludesSeparatePhasesWithBuildExtension()

t.Log("inspecting image")
Expand Down Expand Up @@ -886,6 +888,8 @@ func testAcceptance(
})

it("uses the 5 phases, and runs the extender (run)", func() {
origLifecycle := lifecycle.Image()

output := pack.RunSuccessfully(
"build", repoName,
"-p", filepath.Join("testdata", "mock_app"),
Expand All @@ -897,7 +901,8 @@ func testAcceptance(
assertions.NewOutputAssertionManager(t, output).ReportsSuccessfulImageBuild(repoName)

assertOutput := assertions.NewLifecycleOutputAssertionManager(t, output)
assertOutput.IncludesLifecycleImageTag(lifecycle.Image())

assertOutput.IncludesTagOrEphemeralLifecycle(origLifecycle)
assertOutput.IncludesSeparatePhasesWithRunExtension()

t.Log("inspecting image")
Expand Down Expand Up @@ -977,6 +982,8 @@ func testAcceptance(

when("daemon", func() {
it("uses the 5 phases", func() {
origLifecycle := lifecycle.Image()

output := pack.RunSuccessfully(
"build", repoName,
"-p", filepath.Join("testdata", "mock_app"),
Expand All @@ -986,13 +993,15 @@ func testAcceptance(
assertions.NewOutputAssertionManager(t, output).ReportsSuccessfulImageBuild(repoName)

assertOutput := assertions.NewLifecycleOutputAssertionManager(t, output)
assertOutput.IncludesLifecycleImageTag(lifecycle.Image())
assertOutput.IncludesTagOrEphemeralLifecycle(origLifecycle)
assertOutput.IncludesSeparatePhases()
})
})

when("--publish", func() {
it("uses the 5 phases", func() {
origLifecycle := lifecycle.Image()

buildArgs := []string{
repoName,
"-p", filepath.Join("testdata", "mock_app"),
Expand All @@ -1008,7 +1017,7 @@ func testAcceptance(
assertions.NewOutputAssertionManager(t, output).ReportsSuccessfulImageBuild(repoName)

assertOutput := assertions.NewLifecycleOutputAssertionManager(t, output)
assertOutput.IncludesLifecycleImageTag(lifecycle.Image())
assertOutput.IncludesTagOrEphemeralLifecycle(origLifecycle)
assertOutput.IncludesSeparatePhases()
})
})
Expand Down
9 changes: 7 additions & 2 deletions acceptance/assertions/lifecycle_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package assertions
import (
"fmt"
"regexp"
"strings"
"testing"

h "github.com/buildpacks/pack/testhelpers"
Expand Down Expand Up @@ -85,8 +86,12 @@ func (l LifecycleOutputAssertionManager) IncludesSeparatePhasesWithRunExtension(
l.assert.ContainsAll(l.output, "[detector]", "[analyzer]", "[extender (run)]", "[exporter]")
}

func (l LifecycleOutputAssertionManager) IncludesLifecycleImageTag(tag string) {
func (l LifecycleOutputAssertionManager) IncludesTagOrEphemeralLifecycle(tag string) {
l.testObject.Helper()

l.assert.Contains(l.output, tag)
if !strings.Contains(l.output, tag) {
if !strings.Contains(l.output, "pack.local/lifecyle") {
l.testObject.Fatalf("Unable to locate reference to lifecycle image within output")
}
}
}
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 @@ -4,7 +4,7 @@ Pack:

Default Lifecycle Version: 0.19.3

Supported Platform APIs: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12
Supported Platform APIs: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13

Config:
default-builder-image = "{{ .DefaultBuilder }}"
Expand Down
28 changes: 13 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/buildpacks/pack
require (
github.com/BurntSushi/toml v1.3.2
github.com/Masterminds/semver v1.5.0
github.com/Microsoft/go-winio v0.6.1
github.com/Microsoft/go-winio v0.6.2
github.com/apex/log v1.9.0
github.com/buildpacks/imgutil v0.0.0-20240206215312-f8d38e1de03d
github.com/buildpacks/lifecycle v0.19.3
Expand All @@ -12,15 +12,15 @@ require (
github.com/docker/go-connections v0.5.0
github.com/dustin/go-humanize v1.0.1
github.com/gdamore/tcell/v2 v2.7.4
github.com/go-git/go-git/v5 v5.11.0
github.com/go-git/go-git/v5 v5.12.0
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.19.1
github.com/google/go-github/v30 v30.1.0
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95
github.com/heroku/color v0.0.6
github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e
github.com/onsi/gomega v1.32.0
github.com/onsi/gomega v1.33.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
Expand All @@ -29,12 +29,12 @@ require (
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/sclevine/spec v1.4.0
github.com/spf13/cobra v1.8.0
golang.org/x/crypto v0.21.0
golang.org/x/mod v0.16.0
golang.org/x/oauth2 v0.18.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.18.0
golang.org/x/term v0.18.0
golang.org/x/crypto v0.22.0
golang.org/x/mod v0.17.0
golang.org/x/oauth2 v0.19.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0
golang.org/x/term v0.19.0
golang.org/x/text v0.14.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -51,7 +51,7 @@ require (
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/aws/aws-sdk-go-v2 v1.25.2 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.4 // indirect
Expand Down Expand Up @@ -122,19 +122,17 @@ require (
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
golang.org/x/net v0.23.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Expand Down
Loading

0 comments on commit 18c3a10

Please sign in to comment.