diff --git a/integration/update_builder_test.go b/integration/update_builder_test.go index 7afaeae..dc915eb 100644 --- a/integration/update_builder_test.go +++ b/integration/update_builder_test.go @@ -79,7 +79,7 @@ func testUpdateBuilder(t *testing.T, context spec.G, it spec.S) { nodeConfigPath := fmt.Sprintf("/v2/paketobuildpacks/nodejs/blobs/%s", mustConfigName(t, nodeImg)) nodeManifestReqCount := 0 extensionManifestPath := "/v2/paketocommunity/ubi-nodejs-extension/manifests/0.0.3" - extensionConfigPath := fmt.Sprintf("/v2/paketocommunity/ubi-nodejs-extension/blobs/%s", mustConfigName(t, extensionImg)) + extensionConfigPath := fmt.Sprintf("/v2/paketocommunity/ubi-nodejs-extension/blobs/%s", mustConfigName(t, extensionImg)) extensionManifestReqCount := 0 server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { @@ -258,6 +258,10 @@ description = "Some description" build-image = "REGISTRY-URI/somerepository/build:0.0.10-some-cnb" run-image = "REGISTRY-URI/somerepository/run:some-cnb" run-image-mirrors = ["REGISTRY-URI/some-repository/run:some-cnb"] + +[[targets]] + os = "linux" + arch = "amd64" `), []byte(`REGISTRY-URI`), []byte(strings.TrimPrefix(server.URL, "http://"))), 0600) Expect(err).NotTo(HaveOccurred()) }) @@ -324,6 +328,10 @@ description = "Some description" id = "io.paketo.stacks.some-stack" run-image = "REGISTRY-URI/somerepository/run:some-cnb" run-image-mirrors = ["REGISTRY-URI/some-repository/run:some-cnb"] + +[[targets]] + os = "linux" + arch = "amd64" `, "REGISTRY-URI", strings.TrimPrefix(server.URL, "http://")))) }) diff --git a/internal/builder_config.go b/internal/builder_config.go index d3087be..ee03093 100644 --- a/internal/builder_config.go +++ b/internal/builder_config.go @@ -17,6 +17,7 @@ type BuilderConfig struct { Extensions []BuilderConfigExtension `toml:"extensions"` OrderExtension []BuilderExtensionConfigOrder `toml:"order-extensions"` Stack BuilderConfigStack `toml:"stack"` + Targets []BuilderConfigTarget `toml:"targets"` } type BuilderConfigBuildpack struct { @@ -61,6 +62,11 @@ type BuilderConfigStack struct { RunImageMirrors []string `toml:"run-image-mirrors"` } +type BuilderConfigTarget struct { + OS string `toml:"os"` + Arch string `toml:"arch"` +} + // Note: this is to support that buildpackages can refer to this field as `image` or `uri`. func (b *BuilderConfigBuildpack) UnmarshalTOML(v interface{}) error { if m, ok := v.(map[string]interface{}); ok { diff --git a/internal/builder_config_test.go b/internal/builder_config_test.go index 2c6b709..119e627 100644 --- a/internal/builder_config_test.go +++ b/internal/builder_config_test.go @@ -66,6 +66,14 @@ description = "Some description" build-image = "some-registry/somerepository/build:1.2.3-some-cnb" run-image = "some-registry/somerepository/run:some-cnb" run-image-mirrors = ["some-registry/some-repository/run:some-cnb"] + +[[targets]] + os = "linux" + arch = "amd64" + +[[targets]] + os = "linux" + arch = "arm64" `) Expect(err).NotTo(HaveOccurred()) @@ -135,6 +143,16 @@ description = "Some description" RunImage: "some-registry/somerepository/run:some-cnb", RunImageMirrors: []string{"some-registry/some-repository/run:some-cnb"}, }, + Targets: []internal.BuilderConfigTarget{ + { + OS: "linux", + Arch: "amd64", + }, + { + OS: "linux", + Arch: "arm64", + }, + }, })) }) @@ -262,6 +280,16 @@ description = "Some description" RunImage: "some-registry/somerepository/run:some-cnb", RunImageMirrors: []string{"some-registry/some-repository/run:some-cnb"}, }, + Targets: []internal.BuilderConfigTarget{ + { + OS: "linux", + Arch: "amd64", + }, + { + OS: "linux", + Arch: "arm64", + }, + }, }) Expect(err).NotTo(HaveOccurred()) @@ -309,6 +337,14 @@ description = "Some description" build-image = "some-registry/somerepository/build:1.2.3-some-cnb" run-image = "some-registry/somerepository/run:some-cnb" run-image-mirrors = ["some-registry/some-repository/run:some-cnb"] + +[[targets]] + os = "linux" + arch = "amd64" + +[[targets]] + os = "linux" + arch = "arm64" `)) }) @@ -352,6 +388,16 @@ description = "Some description" RunImage: "some-registry/somerepository/run:some-cnb", RunImageMirrors: []string{"some-registry/some-repository/run:some-cnb"}, }, + Targets: []internal.BuilderConfigTarget{ + { + OS: "linux", + Arch: "amd64", + }, + { + OS: "linux", + Arch: "arm64", + }, + }, }) Expect(err).NotTo(HaveOccurred()) @@ -388,9 +434,17 @@ description = "Some description" build-image = "some-registry/somerepository/build:1.2.3-some-cnb" run-image = "some-registry/somerepository/run:some-cnb" run-image-mirrors = ["some-registry/some-repository/run:some-cnb"] - `)) +[[targets]] + os = "linux" + arch = "amd64" + +[[targets]] + os = "linux" + arch = "arm64" + `)) }) + context("failure cases", func() { context("when the file cannot be opened", func() { it.Before(func() {