Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding BP_UBI_RUN_IMAGE_OVERRIDE environment variable #76

Merged

Conversation

pacostas
Copy link
Contributor

@pacostas pacostas commented Jan 15, 2024

Merge After

@paketo-bot-reviewer

Summary

This PR introduces an new environment variable called BP_UBI_RUN_IMAGE_OVERRIDE. The purpose of this env variable, is to set the run image with the value of BP_UBI_RUN_IMAGE_OVERRIDE.

On the generate phase of the extension, is specified which image should be set as a run image. With this PR, we are able to explicitly set the run image according to the value of BP_UBI_RUN_IMAGE_OVERRIDE. As a result if the BP_UBI_RUN_IMAGE_OVERRIDE environment variable has been set and is not an empty string, the run image will have the value of BP_UBI_RUN_IMAGE_OVERRIDE otherwise is determined on how it used to be in the past, based on the node version.

Use Cases

This change, helps us on setting run images without modifying the source code of the extension (the extension.toml file). E.x. when we release a new stack, we dont have the option to test the release candidate stack without modifying the source code of the extension, as the run image is not published yet to a registry. By explicitly specifying the run image with the BP_UBI_RUN_IMAGE_OVERRIDE, we are able to test that run image, before creating a release and pushing it to a registry.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@pacostas pacostas requested a review from a team as a code owner January 15, 2024 11:08
@pacostas pacostas changed the title Adding bp node run extension Adding BP_NODE_RUN_EXTENSION environment variable Jan 15, 2024
@pacostas pacostas force-pushed the adding-BP_NODE_RUN_EXTENSION branch from 7cf5dbb to 8098e10 Compare January 15, 2024 11:10
generate.go Outdated Show resolved Hide resolved
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just need to add space after // in comment lines. Believe that is what is used in existing comments (at least from my look at the nodejs-engine)

@pacostas pacostas force-pushed the adding-BP_NODE_RUN_EXTENSION branch from d47b917 to ba9adb2 Compare January 17, 2024 09:06
@pacostas pacostas changed the title Adding BP_NODE_RUN_EXTENSION environment variable Adding BP_UBI_RUN_IMAGE_OVERRIDE environment variable Jan 25, 2024
@pacostas pacostas force-pushed the adding-BP_NODE_RUN_EXTENSION branch from 7881dd2 to 0ecb6b7 Compare February 6, 2024 10:49
@pacostas pacostas force-pushed the adding-BP_NODE_RUN_EXTENSION branch from ab22fce to 0ecb6b7 Compare February 13, 2024 15:00
@pacostas
Copy link
Contributor Author

@paketo-bot-reviewer Tests are failing as the #82 hasnt been merged yet.

@thitch97 thitch97 added the semver:minor A change requiring a minor version bump label Feb 16, 2024
@thitch97
Copy link
Contributor

@pacostas this all makes sense to me. Happy to merge it in once the merge conflicts are resolved

@thitch97 thitch97 merged commit 5dcc3ea into paketo-buildpacks:main Feb 16, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants