Comments (4)
The BuildpackMap
is constructed from the buildpack.toml
files in each buildpack on the filesystem[1]. It has no concept of Optional
(even though it re-uses the Buildpack
struct with that field).
Each buildpack in BuildpackMap
can be referenced multiple times in order.toml or group.toml. When lookup
is called in ReadOrder
, we copy the optional
field value onto the value from the BuildpackMap
before returning it, so that you can convert an order.toml file that is missing the info from the buildpack.toml files to a fully-hydrated structure in memory. In the case of group.toml/ReadGroup
, the copying of the Optional
field is meaningless, because optionality isn't relevant after the detection process (which removes optional buildpacks that failed detection).
This code could be tidied up a bit (perhaps by creating different types of buildpack structs for different use cases), but I think the behavior (and spec[2]) are both accurate. Are you seeing otherwise in the behavior of the lifecycle?
[1] https://github.com/buildpack/lifecycle/blob/master/map.go#L21
[2] https://github.com/buildpack/spec/blob/master/platform.md#data-format
from lifecycle.
Sounds like this is a critique of the code readability rather than a bug. I'm inclined to close unless anyone feels strongly to the contrary (we can certainly refactor for clarity but this issue feels misleading)
from lifecycle.
from lifecycle.
@squee1945 I am closing this issue. Feel free to open an issue or PR on the spec repo if you feel that the specification lacks clarity.
from lifecycle.
Related Issues (20)
- Target distro name/version not derived from `/etc/os-release` when Docker labels aren't set HOT 3
- `[[targets.distros]]` in `buildpack.toml` is ignored if the run image distro name/version isn't available HOT 3
- CVE(s) found in v0.19.3 HOT 1
- AppDir should be marked as readonly in export.go HOT 6
- Lifecycle fails to build on a stack other than bionic HOT 2
- Source file mtimes are always set to Jan 1, 1980 HOT 5
- Upgrade lifecycle to go1.22.4 HOT 1
- UX: Call out ordering of buildpacks when failing detection HOT 2
- Sign release tags
- Sign released binaries
- Upgrade lifecycle to go1.22.5 HOT 2
- `CNB_TARGET_ARCH` and `CNB_TARGET_OS` not set correctly when using Platform API 0.9 HOT 3
- Add more data to `report.toml`
- CVE(s) found in v0.19.7 HOT 2
- Placeholder for security work
- Security review: recover corrupt caches HOT 7
- Security review: prevent simultaneous builds of applications having the same name HOT 2
- Breaking usage of buildpacks betwen v0.19.6 and v0.20.0 HOT 1
- Upgrade lifecycle to go1.22.6
- CVE(s) found in v0.20.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lifecycle.