Skip to content

Commit

Permalink
metadata update
Browse files Browse the repository at this point in the history
  • Loading branch information
janisar007 committed Sep 3, 2024
1 parent 4fb56b6 commit 742b0e7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 52 deletions.
60 changes: 23 additions & 37 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,54 @@ api = "0.7"
go = "1.21.*"

[[metadata.dependencies]]
checksum = "sha256:54a87a9325155b98c85bc04dc50298ddd682489eb47f486f2e6cb0707554abf0"
cpe = "cpe:2.3:a:golang:go:1.21.11:*:*:*:*:*:*:*"
id = "go"
licenses = ["BSD-3-Clause"]
name = "Go"
purl = "pkg:generic/go@go1.21.11?checksum=54a87a9325155b98c85bc04dc50298ddd682489eb47f486f2e6cb0707554abf0&download_url=https://go.dev/dl/go1.21.11.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.21.11.src.tar.gz"
source-checksum = "sha256:42aee9bf2b6956c75a7ad6aa3f0a51b5821ffeac57f5a2e733a2d6eae1e6d9d2"
stacks = ["*"]
strip-components = 1
uri = "https://go.dev/dl/go1.21.11.linux-amd64.tar.gz"
version = "1.21.11"

[[metadata.dependencies]]
checksum = "sha256:121ab58632787e18ae0caa8ae285b581f9470d0f6b3defde9e1600e211f583c5"
cpe = "cpe:2.3:a:golang:go:1.21.12:*:*:*:*:*:*:*"
checksum = "sha256:904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0"
cpe = "cpe:2.3:a:golang:go:1.22.5:*:*:*:*:*:*:*"
id = "go"
licenses = ["BSD-3-Clause"]
name = "Go"
purl = "pkg:generic/go@go1.21.12?checksum=121ab58632787e18ae0caa8ae285b581f9470d0f6b3defde9e1600e211f583c5&download_url=https://go.dev/dl/go1.21.12.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.21.12.src.tar.gz"
source-checksum = "sha256:30e68af27bc1f1df231e3ab74f3d17d3b8d52a089c79bcaab573b4f1b807ed4f"
purl = "pkg:generic/go@go1.22.5?checksum=904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0&download_url=https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.22.5.src.tar.gz"
source-checksum = "sha256:ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6"
stacks = ["*"]
strip-components = 1
uri = "https://go.dev/dl/go1.21.12.linux-amd64.tar.gz"
version = "1.21.12"
uri = "https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
version = "1.22.5"

[[metadata.dependencies]]
checksum = "sha256:ba79d4526102575196273416239cca418a651e049c2b099f3159db85e7bade7d"
cpe = "cpe:2.3:a:golang:go:1.22.4:*:*:*:*:*:*:*"
checksum = "sha256:999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616"
cpe = "cpe:2.3:a:golang:go:1.22.6:*:*:*:*:*:*:*"
id = "go"
licenses = ["BSD-3-Clause"]
name = "Go"
purl = "pkg:generic/go@go1.22.4?checksum=ba79d4526102575196273416239cca418a651e049c2b099f3159db85e7bade7d&download_url=https://go.dev/dl/go1.22.4.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.22.4.src.tar.gz"
source-checksum = "sha256:fed720678e728a7ca30ba8d1ded1caafe27d16028fab0232b8ba8e22008fb784"
purl = "pkg:generic/go@go1.22.6?checksum=999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616&download_url=https://go.dev/dl/go1.22.6.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.22.6.src.tar.gz"
source-checksum = "sha256:9e48d99d519882579917d8189c17e98c373ce25abaebb98772e2927088992a51"
stacks = ["*"]
strip-components = 1
uri = "https://go.dev/dl/go1.22.4.linux-amd64.tar.gz"
version = "1.22.4"
uri = "https://go.dev/dl/go1.22.6.linux-amd64.tar.gz"
version = "1.22.6"

[[metadata.dependencies]]
checksum = "sha256:904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0"
cpe = "cpe:2.3:a:golang:go:1.22.5:*:*:*:*:*:*:*"
checksum = "sha256:905a297f19ead44780548933e0ff1a1b86e8327bb459e92f9c0012569f76f5e3"
cpe = "cpe:2.3:a:golang:go:1.23.0:*:*:*:*:*:*:*"
id = "go"
licenses = ["BSD-3-Clause"]
name = "Go"
purl = "pkg:generic/go@go1.22.5?checksum=904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0&download_url=https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.22.5.src.tar.gz"
source-checksum = "sha256:ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6"
purl = "pkg:generic/go@go1.23.0?checksum=905a297f19ead44780548933e0ff1a1b86e8327bb459e92f9c0012569f76f5e3&download_url=https://go.dev/dl/go1.23.0.linux-amd64.tar.gz"
source = "https://go.dev/dl/go1.23.0.src.tar.gz"
source-checksum = "sha256:42b7a8e80d805daa03022ed3fde4321d4c3bf2c990a144165d01eeecd6f699c6"
stacks = ["*"]
strip-components = 1
uri = "https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
version = "1.22.5"
uri = "https://go.dev/dl/go1.23.0.linux-amd64.tar.gz"
version = "1.23.0"

[[metadata.dependency-constraints]]
constraint = "1.21.*"
constraint = "1.22.*"
id = "go"
patches = 2

[[metadata.dependency-constraints]]
constraint = "1.22.*"
constraint = "1.23.*"
id = "go"
patches = 2

Expand Down
6 changes: 3 additions & 3 deletions integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, buildpackInfo.Buildpack.Name)),
" Resolving Go version",
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
"",
fmt.Sprintf(" Generating SBOM for /layers/%s/go", strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_")),
Expand Down
8 changes: 4 additions & 4 deletions integration/environment_variable_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func testEnvironmentVariableConfiguration(t *testing.T, context spec.G, it spec.
image, logs, err = pack.WithNoColor().Build.
WithPullPolicy("never").
WithBuildpacks(buildpack, buildPlanBuildpack).
WithEnv(map[string]string{"BP_GO_VERSION": "1.21.*"}).
WithEnv(map[string]string{"BP_GO_VERSION": "1.22.*"}).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)

Expand All @@ -77,19 +77,19 @@ func testEnvironmentVariableConfiguration(t *testing.T, context spec.G, it spec.
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, buildpackInfo.Buildpack.Name)),
" Resolving Go version",
" Candidate version sources (in priority order):",
" BP_GO_VERSION -> \"1.21.*\"",
" BP_GO_VERSION -> \"1.22.*\"",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using BP_GO_VERSION\): 1\.21\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
))
})
Expand Down
14 changes: 7 additions & 7 deletions integration/layer_reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in \d+(\.?\d+)*`),
))

Expand Down Expand Up @@ -121,7 +121,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
fmt.Sprintf(" Reusing cached layer /layers/%s/go", strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_")),
))
Expand All @@ -136,7 +136,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {

containerIDs[secondContainer.ID] = struct{}{}

Eventually(secondContainer).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(secondContainer).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(secondImage.Buildpacks[0].Layers["go"].SHA).To(Equal(firstImage.Buildpacks[0].Layers["go"].SHA))
})
Expand Down Expand Up @@ -166,7 +166,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
firstImage, _, err := pack.WithNoColor().Build.
WithPullPolicy("never").
WithBuildpacks(buildpack, buildPlanBuildpack).
WithEnv(map[string]string{"BP_GO_VERSION": "1.21.*"}).
WithEnv(map[string]string{"BP_GO_VERSION": "1.22.*"}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred())

Expand All @@ -192,7 +192,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
secondImage, _, err := pack.WithNoColor().Build.
WithPullPolicy("never").
WithBuildpacks(buildpack, buildPlanBuildpack).
WithEnv(map[string]string{"BP_GO_VERSION": "1.22.*"}).
WithEnv(map[string]string{"BP_GO_VERSION": "1.23.*"}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred())

Expand All @@ -212,7 +212,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {

containerIDs[secondContainer.ID] = struct{}{}

Eventually(secondContainer).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))
Eventually(secondContainer).Should(Serve(ContainSubstring("go1.23")).OnPort(8080))

Expect(secondImage.Buildpacks[0].Layers["go"].SHA).NotTo(Equal(firstImage.Buildpacks[0].Layers["go"].SHA))
})
Expand Down
2 changes: 1 addition & 1 deletion integration/offline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func testOffline(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))
})
})
}

0 comments on commit 742b0e7

Please sign in to comment.