From bf1cdacdfced277a7dc2a1888f91c0102a47c387 Mon Sep 17 00:00:00 2001 From: Forest Eckhardt Date: Wed, 11 Sep 2019 12:26:10 -0400 Subject: [PATCH] Makes start command compatible with new libbuildpack [#168418587] --- dep/dep.go | 2 +- dep/dep_test.go | 17 ++++++++--------- go.mod | 4 ++-- go.sum | 4 ++++ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dep/dep.go b/dep/dep.go index 2447c52..0e62064 100644 --- a/dep/dep.go +++ b/dep/dep.go @@ -195,7 +195,7 @@ func (c *Contributor) ContributeStartCommand() error { appName = filepath.Base(c.Targets[0]) } appBinaryPath := filepath.Join(c.appBinaryLayer.Root, appName) - return c.context.Layers.WriteApplicationMetadata(layers.Metadata{Processes: []layers.Process{{"web", appBinaryPath}}}) + return c.context.Layers.WriteApplicationMetadata(layers.Metadata{Processes: []layers.Process{{"web", appBinaryPath, false}}}) } func (c *Contributor) setPackagesMetadata() error { diff --git a/dep/dep_test.go b/dep/dep_test.go index 6463044..354978f 100644 --- a/dep/dep_test.go +++ b/dep/dep_test.go @@ -2,13 +2,14 @@ package dep_test import ( "fmt" - "github.com/cloudfoundry/libcfbuildpack/buildpackplan" - "github.com/cloudfoundry/libcfbuildpack/layers" "io/ioutil" "os" "path/filepath" "testing" + "github.com/cloudfoundry/libcfbuildpack/buildpackplan" + "github.com/cloudfoundry/libcfbuildpack/layers" + "github.com/cloudfoundry/dep-cnb/dep" "github.com/cloudfoundry/libcfbuildpack/test" "github.com/golang/mock/gomock" @@ -64,11 +65,10 @@ func testDep(t *testing.T, when spec.G, it spec.S) { it("reads targets from the buildplan", func() { - factory.AddPlan(generateMetadata( buildpackplan.Metadata{ dep.ImportPath: packageName, - dep.Targets: []interface{}{"first", "second"}, + dep.Targets: []interface{}{"first", "second"}, }), ) @@ -82,7 +82,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) { factory.AddPlan(generateMetadata( buildpackplan.Metadata{ - dep.Targets: []interface{}{}, + dep.Targets: []interface{}{}, }), ) @@ -214,7 +214,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) { Expect(factory.Build.Layers).To(test.HaveApplicationMetadata(layers.Metadata{ Processes: []layers.Process{ { - "web", appBinaryPath, + "web", appBinaryPath, false, }, }, })) @@ -243,7 +243,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) { Expect(factory.Build.Layers).To(test.HaveApplicationMetadata(layers.Metadata{ Processes: []layers.Process{ { - "web", appBinaryPath, + "web", appBinaryPath, false, }, }, })) @@ -276,10 +276,9 @@ func testDep(t *testing.T, when spec.G, it spec.S) { }) } - func generateMetadata(metadata buildpackplan.Metadata) buildpackplan.Plan { return buildpackplan.Plan{ - Name: dep.Dependency, + Name: dep.Dependency, Metadata: metadata, } } diff --git a/go.mod b/go.mod index 9f4cec2..70d0bfa 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/cloudfoundry/dep-cnb go 1.12 require ( - github.com/buildpack/libbuildpack v1.23.0 + github.com/buildpack/libbuildpack v1.24.0 github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4 github.com/cloudfoundry/libcfbuildpack v1.85.0 github.com/golang/mock v1.3.1 @@ -12,5 +12,5 @@ require ( github.com/pkg/errors v0.8.1 github.com/sclevine/spec v1.2.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect - google.golang.org/appengine v1.6.1 // indirect + google.golang.org/appengine v1.6.2 // indirect ) diff --git a/go.sum b/go.sum index 814d9ed..a52d03c 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ github.com/buildpack/libbuildpack v1.19.0 h1:HUkaIwuGmPbQhujBjYNpd+E4f0NdAgAgHq7 github.com/buildpack/libbuildpack v1.19.0/go.mod h1:oxgSTzPbWscHs27iuYrctEZpSak2m/qPThA+9JM0Boo= github.com/buildpack/libbuildpack v1.23.0 h1:J1Bz62zQUeQW/vVzLQrW0DdKgU2P1Aa99nBAigKG11g= github.com/buildpack/libbuildpack v1.23.0/go.mod h1:Amg0Ygeo8V7Lqr5hJ6TtDG7d2FwY2ZUptLpEnOvyfL4= +github.com/buildpack/libbuildpack v1.24.0 h1:RP03dlPcTNATytgQ0uEpbWMzYtO2CIQyiDnpv7ommNE= +github.com/buildpack/libbuildpack v1.24.0/go.mod h1:mU1sClrWw0/Ua1LB+8+ydtZY5dMsa1nEzVMHhcczNVo= github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4 h1:YntXPlrEIZ9/glePgiY0HTecy1EsNhdDz8zFa79tQ6o= github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4/go.mod h1:vbeid+MuoJPZXM8fGvJy87lDLvu/q0Rs1NN4M6lFFg4= github.com/cloudfoundry/libcfbuildpack v1.76.0 h1:oMTv35mjk5Jogzy2sshVXHyolDWnWHMfANQ0UooXJq0= @@ -106,6 +108,8 @@ google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO50 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.2 h1:j8RI1yW0SkI+paT6uGwMlrMI/6zwYA6/CFil8rxOzGI= +google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=