Skip to content

Commit

Permalink
Merge pull request #51 from pacostas/adding-node-20
Browse files Browse the repository at this point in the history
Adding node 20
  • Loading branch information
TisVictress authored Dec 6, 2023
2 parents 37b870b + 69a3a66 commit 5ddaa5e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
9 changes: 8 additions & 1 deletion extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions integration/provides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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):",
" <unknown> -> \"\""))
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
Expand Down
6 changes: 3 additions & 3 deletions integration/simple_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func testSimple(t *testing.T, context spec.G, it spec.S) {
" <unknown> -> \"\"",
))
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
Expand Down Expand Up @@ -452,7 +452,7 @@ func testSimple(t *testing.T, context spec.G, it spec.S) {
" <unknown> -> \"\"",
))
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+\]`),
))
})
})
Expand Down

0 comments on commit 5ddaa5e

Please sign in to comment.