diff --git a/extension.toml b/extension.toml index ee0b14c..53d7da5 100644 --- a/extension.toml +++ b/extension.toml @@ -10,7 +10,14 @@ description = "This extension installs the appropriate nodejs runtime via dnf" pre-package = "./scripts/build.sh" include-files = ["bin/generate", "bin/detect", "bin/run", "extension.toml"] [metadata.default-versions] - node = "18.*.*" + node = "20.*.*" + + [[metadata.dependencies]] + id = "node" + name = "Ubi Node Extension" + stacks = ["io.buildpacks.stacks.ubi8"] + source = "paketocommunity/run-nodejs-20-ubi-base" + version = "20.1000" [[metadata.dependencies]] id = "node" diff --git a/integration/init_test.go b/integration/init_test.go index cc2b03e..3bca778 100644 --- a/integration/init_test.go +++ b/integration/init_test.go @@ -36,6 +36,12 @@ var settings struct { Name string } + Metadata struct { + DefaultVersions struct { + Node string `toml:"node"` + } `toml:"default-versions"` + } `toml:"metadata"` + Buildpack struct { ID string Name string diff --git a/integration/provides_test.go b/integration/provides_test.go index f2dbb0b..543a598 100644 --- a/integration/provides_test.go +++ b/integration/provides_test.go @@ -69,12 +69,13 @@ func testProvides(t *testing.T, context spec.G, it spec.S) { " Resolving Node Engine version", " Candidate version sources (in priority order):", " -> \"\"")) - Expect(logs).To(ContainLines(" Selected Node Engine Major version 18")) + + Expect(logs).To(ContainLines(fmt.Sprintf(" Selected Node Engine Major version %s", strings.Split(settings.Metadata.DefaultVersions.Node, ".")[0]))) Expect(logs).To(ContainLines("===> RESTORING")) Expect(logs).To(ContainLines("===> EXTENDING (BUILD)")) Expect(logs).To(ContainLines( "[extender (build)] Enabling module streams:", - "[extender (build)] nodejs:18")) + fmt.Sprintf("[extender (build)] nodejs:%s", strings.Split(settings.Metadata.DefaultVersions.Node, ".")[0]))) // SBOM is not supported at the moment from UBI image // therefore there are no available logs to test/validate diff --git a/integration/simple_app_test.go b/integration/simple_app_test.go index 41fccac..cebadd5 100644 --- a/integration/simple_app_test.go +++ b/integration/simple_app_test.go @@ -88,12 +88,12 @@ func testSimple(t *testing.T, context spec.G, it spec.S) { " -> \"\"", )) Expect(logs).To(ContainLines( - " Selected Node Engine Major version 18")) + fmt.Sprintf(" Selected Node Engine Major version %s", strings.Split(settings.Metadata.DefaultVersions.Node, ".")[0]))) Expect(logs).To(ContainLines("===> RESTORING")) Expect(logs).To(ContainLines("===> EXTENDING (BUILD)")) Expect(logs).To(ContainLines( "[extender (build)] Enabling module streams:", - "[extender (build)] nodejs:18")) + fmt.Sprintf("[extender (build)] nodejs:%s", strings.Split(settings.Metadata.DefaultVersions.Node, ".")[0]))) // SBOM is not supported at the moment from UBI image // therefore there are no available logs to test/validate @@ -452,7 +452,7 @@ func testSimple(t *testing.T, context spec.G, it spec.S) { " -> \"\"", )) Expect(logs).To(ContainLines( - "failed to satisfy \"node\" dependency version constraint \"~14\": no compatible versions on \"io.buildpacks.stacks.ubi8\" stack. Supported versions are: [18.1000, 16.1000]", + MatchRegexp(`failed to satisfy \"node\" dependency version constraint \"~14\": no compatible versions on \"io.buildpacks.stacks.ubi8\" stack. Supported versions are: \[(?:\d+\.\d+(?:, )?)*\d+\.\d+\]`), )) }) })