Skip to content

Declare cluster.x-k8s.io/v1beta2 contract support in CRD labels - #391

Closed
poussa wants to merge 1 commit into
kubernetes-sigs:mainfrom
poussa:v1beta2-contract
Closed

poussa wants to merge 1 commit into
kubernetes-sigs:mainfrom
poussa:v1beta2-contract

Conversation

@poussa

@poussa poussa commented Jul 31, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

Adds the cluster.x-k8s.io/v1beta2 contract label to CAPK's infrastructure CRDs
(KubevirtCluster, KubevirtClusterTemplate, KubevirtMachine, KubevirtMachineTemplate) via
config/crd/kustomization.yaml, so that core Cluster API v1.13+ can recognize CAPK as
v1beta2-contract-compatible.

This is a metadata-only change, the same mechanism used to originally add the v1beta1 label:

commonLabels: ... cluster.x-k8s.io/v1beta1: v1alpha1

• cluster.x-k8s.io/v1beta2: v1alpha1

No Go dependency bump, no controller code changes, and no change to the CRD's served/storage
API version (v1alpha1 remains the only served version). CAPK continues to watch and reconcile
v1alpha1 resources exactly as before.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #390

Special notes for your reviewer:

This is intentionally much narrower than the earlier v1beta2 effort in #328, which bumped the
cluster-api Go module to v1.11 and updated CAPK's own condition types — that change broke
users still on CAPI v1.10 and was reverted in #361/#363.

This PR does not touch CAPK's dependencies or code at all; it only adds a contract label so that
core CAPI's Cluster/topology controllers can resolve infrastructureRef/controlPlaneRef
lookups when a Cluster is created with apiVersion: cluster.x-k8s.io/v1beta2. Because the
underlying CRD API version is unchanged, this should be safe for users on any CAPI version,
including those still on v1beta1/v1.10.

Verified locally:

  • kustomize build config/crd shows cluster.x-k8s.io/v1beta2: v1alpha1 on all 4 CRDs.
  • Applied the patched CRDs to a live management cluster running CAPI v1.13.4 + this CAPK
    controller (v0.11.2, unmodified). Created a scratch Cluster (apiVersion: cluster.x-k8s.io/v1beta2) referencing KubevirtCluster via the new infrastructureRef.apiGroup
    style. The core CAPI controller correctly resolved the contract, set
    ownerReferences[].apiVersion: cluster.x-k8s.io/v1beta2 on the KubevirtCluster, and began
    reconciling normally (no "contract not found"/CRD lookup errors). capk-controller-manager
    remained healthy and unaffected throughout.

Release notes:

Add `cluster.x-k8s.io/v1beta2` contract label to CAPK infrastructure CRDs, enabling Cluster API
v1beta2 Cluster resources to reference KubevirtCluster/KubevirtMachine as infrastructure providers.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: poussa
Once this PR has been reviewed and has the lgtm label, please assign justinsb 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

@kubernetes-prow
kubernetes-prow Bot requested review from nunnatsa and qinqon July 31, 2026 12:28
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @poussa!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-kubevirt 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-kubevirt has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 31, 2026
@poussa

poussa commented Jul 31, 2026

Copy link
Copy Markdown
Author

This PR is not enough. Need code level changes. Closing (for real now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CAPK missing cluster.x-k8s.io/v1beta2 support

1 participant