Skip to content

Commit

Permalink
Merge pull request #310 from kevin-ortega/ChangeOLDefaultProfile
Browse files Browse the repository at this point in the history
Change Open Liberty default profile to kernel
  • Loading branch information
dmikusa authored Nov 23, 2022
2 parents 956723a + 4ff2afd commit f7ad62c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The buildpack will support all available profiles of the most recent versions of
| `$BP_JAVA_APP_SERVER` | The application server to use. It defaults to `` (empty string) which means that order dictates which Java application server is installed. The first Java application server buildpack to run will be picked. |
| `$BP_LIBERTY_INSTALL_TYPE` | [Install type](#install-types) of Liberty. Valid options: `ol`, `wlp`, and `none`. Defaults to `ol`. |
| `$BP_LIBERTY_VERSION` | The version of Liberty to install. Defaults to the latest version of the runtime. To see what version is available with your version of the buildpack, please see the [release notes](https://github.com/paketo-buildpacks/liberty/releases). At present, only the latest version is supported, and you need to use an older version of the buildpack if you want an older version of Liberty. |
| `$BP_LIBERTY_PROFILE` | The Liberty profile to use. Defaults to `full` for Open Liberty but will change to `kernel` in a subsequent release. The default for WebSphere Liberty is `kernel`. |
| `$BP_LIBERTY_PROFILE` | The Liberty profile to use. Defaults to `kernel`. |
| `$BP_LIBERTY_SERVER_NAME` | Name of the server to use. Defaults to `defaultServer` when building an application. If building a packaged server and there is only one bundled server present, then the buildpack will use that. |
| `$BP_LIBERTY_CONTEXT_ROOT` | If the [server.xml](#bindings) does not have an [application](https://openliberty.io/docs/latest/reference/config/application.html) named `app` defined, then the buildpack will generate one and use this value as the context root. Defaults to the value of `/`. This setting is ignored if server.xml has an application named `app` already defined. |
| `$BP_LIBERTY_FEATURES` | Space separated list of Liberty features to be installed with the Liberty runtime. Supports any valid Liberty feature. See the [Liberty Documentation](https://openliberty.io/docs/latest/reference/feature/feature-overview.html) for available features. |
Expand Down
4 changes: 1 addition & 3 deletions liberty/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package liberty

import (
"fmt"
"github.com/heroku/color"
"github.com/paketo-buildpacks/liberty/internal/util"
"github.com/paketo-buildpacks/libpak/bindings"
sherpa "github.com/paketo-buildpacks/libpak/sherpa"
Expand Down Expand Up @@ -155,8 +154,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) {
profile, _ := cr.Resolve("BP_LIBERTY_PROFILE")
if profile == "" {
if installType == openLibertyInstall {
b.Logger.Info(color.YellowString("Warning: The default profile for Open Liberty will change from 'full' to 'kernel' after 2022-11-01. To continue using the full profile, build with the argument '--env BP_LIBERTY_PROFILE=full'"))
profile = "full"
profile = "kernel"
} else if installType == websphereLibertyInstall {
profile = "kernel"
}
Expand Down
10 changes: 5 additions & 5 deletions liberty/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
{"name": "BP_LIBERTY_SERVER_NAME", "default": "", "build": true},
},
"dependencies": []map[string]interface{}{
{"id": "open-liberty-runtime-full", "version": "21.0.11"},
{"id": "open-liberty-runtime-kernel", "version": "21.0.11"},
{"id": "websphere-liberty-runtime-kernel", "version": "21.0.11"},
{"id": "open-liberty-runtime-jakartaee9", "version": "21.0.11"},
},
Expand Down Expand Up @@ -107,7 +107,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
Expect(os.Unsetenv("BP_LIBERTY_PROFILE")).To(Succeed())
})

it("selects the latest full profile for Open Liberty by default", func() {
it("selects the latest kernel profile for Open Liberty by default", func() {
result, err := liberty.Build{
Logger: bard.NewLogger(io.Discard),
SBOMScanner: &sbomScanner,
Expand All @@ -118,7 +118,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
Expect(result.Layers).To(HaveLen(3))
Expect(result.Layers[0].Name()).To(Equal("helper"))
Expect(result.Layers[1].Name()).To(Equal("base"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-full"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-kernel"))

sbomScanner.AssertCalled(t, "ScanLaunch", ctx.Application.Path, libcnb.SyftJSON, libcnb.CycloneDXJSON)
})
Expand Down Expand Up @@ -316,7 +316,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
Expect(result.Layers).To(HaveLen(3))
Expect(result.Layers[0].Name()).To(Equal("helper"))
Expect(result.Layers[1].Name()).To(Equal("base"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-full"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-kernel"))
Expect(result.Unmet).To(HaveLen(0))

sbomScanner.AssertCalled(t, "ScanLaunch", filepath.Join(ctx.Application.Path, "usr", "servers", "defaultServer"), libcnb.SyftJSON, libcnb.CycloneDXJSON)
Expand Down Expand Up @@ -352,7 +352,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
Expect(result.Layers).To(HaveLen(3))
Expect(result.Layers[0].Name()).To(Equal("helper"))
Expect(result.Layers[1].Name()).To(Equal("base"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-full"))
Expect(result.Layers[2].Name()).To(Equal("open-liberty-runtime-kernel"))
Expect(result.Unmet).To(HaveLen(0))

sbomScanner.AssertCalled(t, "ScanLaunch", ctx.Application.Path, libcnb.SyftJSON, libcnb.CycloneDXJSON)
Expand Down

0 comments on commit f7ad62c

Please sign in to comment.