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

Use correct run image label name for distro name/version #1325

Merged

Conversation

edmorley
Copy link
Contributor

@edmorley edmorley commented Mar 27, 2024

Summary

The spec and docs say that the base image distro and version should be specified via the run image Docker image labels io.buildpacks.base.distro.name and io.buildpacks.base.distro.version. See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

However, until now the lifecycle implementation was checking for label names that were missing the .base substring from the name.

This causes distro name/version buildpack.toml target detection to fail, as well as the env vars CNB_TARGET_DISTRO_NAME and CNB_TARGET_DISTRO_VERSION to not be set correctly in the buildpack environment.

Release notes

The lifecycle now correctly extracts the target distro name and version from the run image labels io.buildpacks.base.distro.name and io.buildpacks.base.distro.version.

Related

Fixes #1324.

The spec and docs say that the run image distro and version should be
specified via the Docker image labels `io.buildpacks.base.distro.name`
and `io.buildpacks.base.distro.version`.

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

However, until now the lifecycle implementation was checking for
label names that were missing the `.base` substring from the name.

This causes distro name/version `buildpack.toml` target detection
to fail, as well as the env vars `CNB_TARGET_DISTRO_NAME` and
`CNB_TARGET_DISTRO_VERSION` not to be set correctly in the
buildpack environment.

Fixes buildpacks#1324.

Signed-off-by: Ed Morley <501702+edmorley@users.noreply.github.com>
@edmorley edmorley requested a review from a team as a code owner March 27, 2024 22:47
edmorley added a commit to heroku/libcnb.rs that referenced this pull request Mar 28, 2024
Since the relevant distros run image Docker label names are
`io.buildpacks.base.distro.name` and `io.buildpacks.base.distro.version`. 

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

I believe the rustdocs here were based on the `lifecycle` codebase,
which uses the wrong label name, and is about to be fixed:
buildpacks/lifecycle#1325
edmorley added a commit to heroku/libcnb.rs that referenced this pull request Mar 28, 2024
Since the relevant distros run image Docker label names are
`io.buildpacks.base.distro.name` and `io.buildpacks.base.distro.version`. 

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

I believe the rustdocs here were based on the `lifecycle` codebase,
which uses the wrong label name, and is about to be fixed:
buildpacks/lifecycle#1325
edmorley added a commit to heroku/libcnb.rs that referenced this pull request Mar 28, 2024
Since the relevant distros run image Docker label names are
`io.buildpacks.base.distro.name` and `io.buildpacks.base.distro.version`. 

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

I believe the rustdocs here were based on the `lifecycle` codebase,
which uses the wrong label name, and is about to be fixed:
buildpacks/lifecycle#1325
Copy link
Contributor

@jabrown85 jabrown85 left a comment

Choose a reason for hiding this comment

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

Looks good to me. @natalieparellano want to merge and cut a release? No one seems to be setting the incorrect label so we are thinking we can ship this in a patch version.

edmorley added a commit to heroku/libcnb.rs that referenced this pull request Mar 28, 2024
Since the relevant distros run image Docker label names are
`io.buildpacks.base.distro.name` and `io.buildpacks.base.distro.version`. 

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

I believe the rustdocs here were based on the `lifecycle` codebase,
which uses the wrong label name, and is about to be fixed:
buildpacks/lifecycle#1325
@natalieparellano natalieparellano merged commit 9f9ac3c into buildpacks:main Mar 28, 2024
8 checks passed
@edmorley edmorley deleted the fix-run-image-distro-labels branch March 28, 2024 13:47
natalieparellano pushed a commit that referenced this pull request Mar 28, 2024
The spec and docs say that the run image distro and version should be
specified via the Docker image labels `io.buildpacks.base.distro.name`
and `io.buildpacks.base.distro.version`.

See:
https://github.com/buildpacks/spec/blob/buildpack/v0.10/platform.md#target-data

However, until now the lifecycle implementation was checking for
label names that were missing the `.base` substring from the name.

This causes distro name/version `buildpack.toml` target detection
to fail, as well as the env vars `CNB_TARGET_DISTRO_NAME` and
`CNB_TARGET_DISTRO_VERSION` not to be set correctly in the
buildpack environment.

Fixes #1324.

Signed-off-by: Ed Morley <501702+edmorley@users.noreply.github.com>
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.

CNB_TARGET_DISTRO_NAME and CNB_TARGET_DISTRO_VERSION not set correctly in buildpack env
3 participants