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

Add BuildpackForKey helper method. #165

Merged
merged 1 commit into from Sep 6, 2022
Merged

Add BuildpackForKey helper method. #165

merged 1 commit into from Sep 6, 2022

Conversation

robdimsdale
Copy link
Member

Summary

This PR adds a helper method on occam.Image to easily facilitate looking up the metadata for a buildpack by its key. This enables consumers to avoid iterating through the buildpack array and/or hard-coding buildpack index.

Use Cases

There are multiple situations (e.g. this, and this) where we hard-code the buildpack index. This is brittle, as it breaks if a buildpack is added to or removed from the build order.

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).

- this enables consumers to avoid iterating through the buildpack array and/or hard-coding buildpack index.
@robdimsdale robdimsdale merged commit 0618297 into main Sep 6, 2022
@robdimsdale robdimsdale deleted the buildpack-for-key branch September 6, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants