dmikusa / binding-tool

Generate Kubernetes service bindings for use with Cloud Native Buildpacks
Apache License 2.0
27 stars 4 forks source link

Error: sha256 field is required for latest paketo-buildpacks/nginx #26

Closed jansu76 closed 6 months ago

jansu76 commented 1 year ago

Using latest version of https://github.com/paketo-buildpacks/nginx fails with error sha256 field is required

bt dm -b paketo-buildpacks/nginx
Error: sha256 field is required

buildpack.toml for nginx buildpack does not contain a sha256 field. Instead it has a checksum field: https://github.com/paketo-buildpacks/nginx/blob/main/buildpack.toml#L43-L54

dmikusa commented 1 year ago

Thanks for opening this issue. This was a recent change in buildpack.toml metadata for Paketo. We'll need to add support for this also.

dmikusa commented 1 year ago

Notes:

The original RFC was amended in https://github.com/paketo-buildpacks/rfcs/pull/261. You can see the expected format here: https://github.com/paketo-buildpacks/rfcs/blob/main/text/0010-dependency-mappings.md#service-binding-specification-for-kubernetes-example

the short answer is the the filename is now <algorithm>:<hash>

MischaFrank commented 1 year ago

For the moment we just replace "checksum" with the old "sha256" name. RUN find /cnb/ -name *.toml | xargs sed -i 's#checksum = "sha256:#sha256 = "#g'

dmikusa commented 6 months ago

Initial support for this has been implemented in https://github.com/dmikusa/binding-tool/pull/136.

This supports checksum = "sha256:<hash>" only. At the moment, that's OK as sha256 is the only checksum being used in Paketo buildpacks.

patst commented 6 months ago

Initial support for this has been implemented in #136.

This supports checksum = "sha256:<hash>" only. At the moment, that's OK as sha256 is the only checksum being used in Paketo buildpacks.

@dmikusa just one addition: the dotnet buildpack already uses sha512:

https://github.com/paketo-buildpacks/dotnet-core-sdk/blob/46fd6bbfe0ce38cd38efa2c1b30dbf736313cf2a/buildpack.toml#L22C24-L22C152

dmikusa commented 6 months ago

Thanks @patst I'll make a note of that.