Skip to content

User-facing migration to ClusterBundle#702

Open
erikgb wants to merge 1 commit intocert-manager:mainfrom
erikgb:migrate-to-clusterbundle
Open

User-facing migration to ClusterBundle#702
erikgb wants to merge 1 commit intocert-manager:mainfrom
erikgb:migrate-to-clusterbundle

Conversation

@erikgb
Copy link
Member

@erikgb erikgb commented Aug 25, 2025

This PR introduces the new ClusterBundle CRD and enables the migration controller according to the accepted design.

The main controller is changed to reconcile ClusterBundle instead of Bundle.

I've tried to keep this PR as small as possible to make it easier to review. We will likely need to add additional tests for the new features in the ClusterBundle API (e.g., multiple keys) and consolidate the existing tests due to the more generic API. However, I suggest handling this in follow-up PRs. Let me know what you think!

@cert-manager-prow cert-manager-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Aug 25, 2025
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thatsmrtalbot for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 25, 2025
@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from ec6c107 to 551e847 Compare September 19, 2025 16:46
@cert-manager-prow cert-manager-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 19, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 551e847 to d9dd750 Compare September 21, 2025 16:49
@cert-manager-prow cert-manager-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 25, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 0b8b584 to 9dac46d Compare October 7, 2025 20:43
@cert-manager-prow cert-manager-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 7, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 2da597b to f9e3118 Compare October 11, 2025 21:06
@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 2062dd2 to f114776 Compare November 9, 2025 11:27
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2025
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from f114776 to b87a514 Compare December 28, 2025 16:36
@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 7, 2026
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from b87a514 to 688c870 Compare January 17, 2026 10:23
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2026
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 9947942 to b456e1d Compare January 18, 2026 19:29
@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2026
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from b456e1d to b87b744 Compare January 20, 2026 10:06
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2026
@erikgb erikgb requested a review from Copilot January 20, 2026 10:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements a migration from the deprecated trust.cert-manager.io/v1alpha1 Bundle API to the new trust-manager.io/v1alpha2 ClusterBundle API. The PR includes automatic migration via a controller that converts existing Bundle resources to ClusterBundle resources, maintains backward compatibility for JKS format through annotations, and adds appropriate deprecation warnings.

Changes:

  • Introduces the new ClusterBundle API (trust-manager.io/v1alpha2) with updated resource structure
  • Adds migration controller to automatically convert Bundle -> ClusterBundle
  • Updates all internal code to work with ClusterBundle API
  • Adds deprecation warnings and markers to the old Bundle API
  • Restructures bundle sources and targets (inLineCAs, includeDefaultCAs, KeyValueTarget)
  • Removes JKS support in favor of PKCS12 (with backward compatibility via annotations)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/apis/trust/v1alpha1/types_bundle.go Added deprecation warnings to Bundle and BundleList types
pkg/bundle/controller/bundle_controller.go Added migration controller to convert Bundle to ClusterBundle
pkg/webhook/cluster_bundle.go New webhook validator for ClusterBundle resources
test/gen/bundle.go Updated test generator to create ClusterBundle objects
pkg/bundle/internal/source/source.go Refactored to accept BundleSpec instead of sources array
pkg/bundle/internal/target/target.go Updated hash calculation and binary data generation for new API structure
deploy/crds/*.yaml Added ClusterBundle CRD and deprecated Bundle CRD
make/00_mod.mk Removed CRD exclusion to make ClusterBundle user-facing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@erikgb erikgb force-pushed the migrate-to-clusterbundle branch 4 times, most recently from 44b4cb1 to 61c357b Compare January 20, 2026 20:43
@erikgb erikgb changed the title WIP: User-facing migration to ClusterBundle User-facing migration to ClusterBundle Jan 20, 2026
@cert-manager-prow cert-manager-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@erikgb erikgb requested a review from Copilot January 20, 2026 20:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@erikgb erikgb requested a review from SgtCoDFish January 20, 2026 21:04
@erikgb
Copy link
Member Author

erikgb commented Jan 20, 2026

/cc @SgtCoDFish

Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

Some fairly superficial comments, but I think worth raising. I want to try and sit down and test this properly but I haven't got bandwidth for that today I don't think!

Signed-off-by: Erik Godding Boye <egboye@gmail.com>
@erikgb erikgb force-pushed the migrate-to-clusterbundle branch from 982c1a7 to 135facf Compare January 21, 2026 12:37
@erikgb
Copy link
Member Author

erikgb commented Jan 21, 2026

Thanks for the initial review, @SgtCoDFish. All your remarks should be addressed now.

I probably want to cut a new release before this is merged. So...

/hold

@cert-manager-prow cert-manager-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2026
@erikgb erikgb requested a review from SgtCoDFish January 21, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants