Skip to content

feat: Migrate kp import to v1 API with ClusterLifecycle and ClusterBuildpack support#434

Merged
tomkennedy513 merged 2 commits intobuildpacks-community:mainfrom
neil-hickey:feat/v3-dependency-descriptor
Jan 23, 2026
Merged

feat: Migrate kp import to v1 API with ClusterLifecycle and ClusterBuildpack support#434
tomkennedy513 merged 2 commits intobuildpacks-community:mainfrom
neil-hickey:feat/v3-dependency-descriptor

Conversation

@neil-hickey
Copy link
Contributor

@neil-hickey neil-hickey commented Jan 22, 2026

Summary

This PR migrates the kp import command to use the new v1 API (kp.kpack.io/v1) with support for ClusterLifecycle and ClusterBuildpack CRDs.

Changes

API Version Migration

  • Update dependency descriptor to support kp.kpack.io/v1 API version
  • Add automatic conversion from v1alpha1 and v1alpha3 descriptors to v1
  • Replace ConfigMap-based lifecycle management with ClusterLifecycle CRDs

ClusterLifecycle Support

  • Import creates ClusterLifecycle resources instead of updating the lifecycle ConfigMap
  • Support for multiple named lifecycles in a single descriptor
  • Add defaultClusterLifecycle field for aliasing (creates a "default-lifecycle" alias)
  • Lifecycle images are pre-loaded (relocated) to the default repository

ClusterBuildpack Support

  • Add new clusterBuildpacks section to dependency descriptor
  • Support for standalone buildpack images (not part of a store)
  • Add defaultClusterBuildpack field for aliasing (creates a "default" alias)
  • Buildpack images are pre-loaded (relocated) to the default repository
  • Buildpack image validation (checks for io.buildpacks.buildpackage.metadata label)

ClusterBuilder Improvements

  • Skip store reference in ClusterBuilder when clusterStore field is empty
  • Allows builders that only use ClusterBuildpacks without a ClusterStore

Code Organization

  • Move descriptor types and conversion logic to pkg/import/descriptor/
  • Separate files for each API version (v1alpha1.go, v1alpha3.go, v1.go)
  • Add LastAppliedConfiguration annotation to ClusterLifecycle and ClusterBuildpack

Example v1 Descriptor

apiVersion: kp.kpack.io/v1
kind: DependencyDescriptor
defaultClusterLifecycle: my-lifecycle
defaultClusterBuildpack: my-buildpack
defaultClusterStack: my-stack
defaultClusterBuilder: my-builder
clusterLifecycles:
  - name: my-lifecycle
    image: paketobuildpacks/lifecycle:0.20.5
clusterBuildpacks:
  - name: my-buildpack
    image: paketobuildpacks/java:latest
clusterStores:
  - name: my-store
    sources:
      - image: gcr.io/paketo-buildpacks/java
clusterStacks:
  - name: my-stack
    buildImage:
      image: paketobuildpacks/build-jammy-base
    runImage:
      image: paketobuildpacks/run-jammy-base
clusterBuilders:
  - name: my-builder
    clusterStack: my-stack
    clusterStore: my-store
    order:
      - group:
          - id: paketo-buildpacks/java

Backward Compatibility

  • v1alpha1 and v1alpha3 descriptors are automatically converted to v1 format
  • Existing descriptors continue to work without modification
  • The lifecycle field in v1alpha3 is converted to a ClusterLifecycle named "default-lifecycle"

@neil-hickey neil-hickey requested a review from a team as a code owner January 22, 2026 21:24
…ildpack support

This PR migrates the kp import command to use the new v1 API (kp.kpack.io/v1)
with support for ClusterLifecycle and ClusterBuildpack CRDs.

API Version Migration:
- Update dependency descriptor to support kp.kpack.io/v1 API version
- Add automatic conversion from v1alpha1 and v1alpha3 descriptors to v1
- Replace ConfigMap-based lifecycle management with ClusterLifecycle CRDs

ClusterLifecycle Support:
- Import creates ClusterLifecycle resources instead of updating the lifecycle ConfigMap
- Support for multiple named lifecycles in a single descriptor
- Add defaultClusterLifecycle field for aliasing (creates a 'default-lifecycle' alias)
- Lifecycle images are pre-loaded (relocated) to the default repository

ClusterBuildpack Support:
- Add new clusterBuildpacks section to dependency descriptor
- Support for standalone buildpack images (not part of a store)
- Add defaultClusterBuildpack field for aliasing (creates a 'default' alias)
- Buildpack images are pre-loaded (relocated) to the default repository
- Buildpack image validation (checks for io.buildpacks.buildpackage.metadata label)

ClusterBuilder Improvements:
- Skip store reference in ClusterBuilder when clusterStore field is empty
- Allows builders that only use ClusterBuildpacks without a ClusterStore

Code Organization:
- Move descriptor types and conversion logic to pkg/import/descriptor/
- Separate files for each API version (v1alpha1.go, v1alpha3.go, v1.go)
- Add LastAppliedConfiguration annotation to ClusterLifecycle and ClusterBuildpack

Backward Compatibility:
- v1alpha1 and v1alpha3 descriptors are automatically converted to v1 format
- Existing descriptors continue to work without modification
- The lifecycle field in v1alpha3 is converted to a ClusterLifecycle named 'default-lifecycle'
@neil-hickey neil-hickey force-pushed the feat/v3-dependency-descriptor branch from 99999c1 to be60823 Compare January 22, 2026 21:26
@tomkennedy513
Copy link
Contributor

lgtm. Adding as a note because we talked about it out of band, but I feel comfortable going to a v1 api for the descriptor because it now includes all the resources we have (which are quite stable and could arguably move to v1) and we don't plan to add anymore.

@tomkennedy513 tomkennedy513 merged commit 6953341 into buildpacks-community:main Jan 23, 2026
1 check passed
@neil-hickey neil-hickey deleted the feat/v3-dependency-descriptor branch January 23, 2026 17:04
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.

2 participants