diff --git a/pkg/cnb/builder_builder.go b/pkg/cnb/builder_builder.go index a292312a0..959c762c1 100644 --- a/pkg/cnb/builder_builder.go +++ b/pkg/cnb/builder_builder.go @@ -152,8 +152,10 @@ func (bb *builderBlder) WriteableImage() (v1.Image, error) { } return imagehelpers.SetLabels(image, map[string]interface{}{ - buildpackOrderLabel: bb.order, - buildpackLayersLabel: buildpackLayerMetadata, + buildpackOrderLabel: bb.order, + buildpackLayersLabel: buildpackLayerMetadata, + lifecycleApisLabel: bb.LifecycleMetadata.APIs, + lifecycleVersionLabel: bb.LifecycleMetadata.Version, buildpackMetadataLabel: BuilderImageMetadata{ Description: "Custom Builder built with kpack", Stack: StackMetadata{ diff --git a/pkg/cnb/buildpack_metadata.go b/pkg/cnb/buildpack_metadata.go index 87fabe508..216478ad5 100644 --- a/pkg/cnb/buildpack_metadata.go +++ b/pkg/cnb/buildpack_metadata.go @@ -9,6 +9,8 @@ const ( buildpackLayersLabel = "io.buildpacks.buildpack.layers" buildpackMetadataLabel = "io.buildpacks.builder.metadata" lifecycleMetadataLabel = "io.buildpacks.lifecycle.metadata" + lifecycleVersionLabel = "io.buildpacks.lifecycle.version" + lifecycleApisLabel = "io.buildpacks.lifecycle.apis" ) type BuildpackLayerInfo struct { @@ -61,7 +63,10 @@ type LifecycleMetadata struct { type LifecycleDescriptor struct { Info LifecycleInfo `toml:"lifecycle"` - API LifecycleAPI `toml:"api"` + + // Deprecated: Use `LifecycleAPIs` instead + API LifecycleAPI `toml:"api" json:"api,omitempty"` + APIs LifecycleAPIs `toml:"apis" json:"apis,omitempty"` } type LifecycleInfo struct {