From b6c6002a2ec94d453d0f5a1a134358dda7b7adc0 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 8 Feb 2022 10:31:53 -0500 Subject: [PATCH] Allow disabling the BOM label We are currently supporting the old-style BOM label and the new-style SBOM layer. By default, we output both. In some situations, if the BOM label grows large enough the resulting will not run on Kubernetes. It fails because the label is too large. You may now set the `BP_BOM_LABEL_DISABLED` env variable to `true` and on the next build, the BOM label will not be included with the image. The label is included by default, despite this known issue, to for backward compatibility. Signed-off-by: Daniel Mikusa --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index a592419..d90490e 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ import ( "github.com/buildpacks/libcnb" "github.com/paketo-buildpacks/libpak/internal" + "github.com/paketo-buildpacks/libpak/sherpa" ) // Main is called by the main function of a buildpack, encapsulating both detection and build in the same binary. @@ -29,6 +30,7 @@ func Main(detector libcnb.Detector, builder libcnb.Builder, options ...libcnb.Op libcnb.WithEnvironmentWriter(internal.NewEnvironmentWriter()), libcnb.WithExitHandler(internal.NewExitHandler()), libcnb.WithTOMLWriter(internal.NewTOMLWriter()), + libcnb.WithBOMLabel(!sherpa.ResolveBool("BP_BOM_LABEL_DISABLED")), }, options...)..., ) }