Skip to content

OCPCLOUD-3407: Upgrade CAPI to v1.12.3 and K8s to 1.34#841

Draft
CrystalChun wants to merge 2 commits intoopenshift:masterfrom
CrystalChun:upgrade
Draft

OCPCLOUD-3407: Upgrade CAPI to v1.12.3 and K8s to 1.34#841
CrystalChun wants to merge 2 commits intoopenshift:masterfrom
CrystalChun:upgrade

Conversation

@CrystalChun
Copy link

@CrystalChun CrystalChun commented Mar 11, 2026

Includes additional changes:

  • Util function isOwnedByOjbect now requires the target owner's group version kind passed in as the last argument.
  • GVK additions now that client's GET doesn't return the type Meta for objects

Summary by CodeRabbit

  • Improvements

    • Made controlPlaneEndpoint host and port fields optional for greater flexibility in cluster configuration.
    • Enhanced resource ownership tracking for improved reliability.
  • Chores

    • Updated Kubernetes and Cluster API dependencies to latest patch releases for improved stability and upstream fixes.

Util function `isOwnedByOjbect` now requires the target owner's group
version kind passed in as the last argument.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 11, 2026

@CrystalChun: This pull request references OCPCLOUD-3407 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Includes additional changes:

  • Util function isOwnedByOjbect now requires the target owner's group version kind passed in as the last argument.
  • GVK additions now that client's GET doesn't return the type Meta for objects

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2026
@CrystalChun
Copy link
Author

/test ?

@openshift-ci
Copy link

openshift-ci bot commented Mar 11, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68d2188c-0b1c-44e2-b016-36bf5e745793

📥 Commits

Reviewing files that changed from the base of the PR and between 734f011 and 7f2f516.

⛔ Files ignored due to path filters (48)
  • api/go.sum is excluded by !**/*.sum
  • api/vendor/modules.txt is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go is excluded by !**/vendor/**, !**/zz_generated*
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go is excluded by !**/vendor/**, !**/zz_generated*
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/clusterclass_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/common_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_phase_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinehealthcheck_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machineset_types.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/v1beta1_condition_consts.go is excluded by !**/vendor/**
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.deepcopy.go is excluded by !**/vendor/**, !**/zz_generated*
  • api/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.openapi.go is excluded by !**/vendor/**, !**/zz_generated*
  • go.sum is excluded by !**/*.sum
  • vendor/k8s.io/client-go/tools/cache/controller.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/cache/delta_fifo.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/cache/reflector.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/cache/shared_informer.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/cache/the_real_fifo.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/clusterclass_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/common_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_phase_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinehealthcheck_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machineset_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/v1beta1_condition_consts.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.openapi.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/sigs.k8s.io/cluster-api/util/conditions/setter.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/util/conditions/sort.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/util/patch/patch.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/util/patch/utils.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/cluster-api/util/util.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (5)
  • api/go.mod
  • config/crd/bases/capi-provider.agent-install.openshift.io_agentclusters.yaml
  • controllers/agentcluster_controller.go
  • controllers/agentcluster_controller_test.go
  • go.mod
💤 Files with no reviewable changes (1)
  • config/crd/bases/capi-provider.agent-install.openshift.io_agentclusters.yaml

Walkthrough

Updates Go module dependencies to newer patch releases, including Kubernetes API libraries and cluster-api framework. Modifies the AgentCluster controller to explicitly compute GroupVersionKind and use explicit GroupKind when verifying ownership of ClusterDeployment. Removes required constraints on controlPlaneEndpoint fields in the CRD.

Changes

Cohort / File(s) Summary
Go Module Dependencies
api/go.mod, go.mod
Updated k8s.io packages (apimachinery, client-go, api, apiextensions-apiserver) from v0.34.2 to v0.34.3; upgraded sigs.k8s.io/cluster-api from v1.11.0 to v1.12.3; upgraded sigs.k8s.io/controller-runtime to v0.22.5. Updated replace directive for cluster-api and removed spf13/pflag indirect dependency.
CRD Schema
config/crd/bases/capi-provider.agent-install.openshift.io_agentclusters.yaml
Removed required constraints on host and port fields under controlPlaneEndpoint in both v1alpha1 and v1beta1 schemas, making these fields optional.
Controller Implementation
controllers/agentcluster_controller.go
Added GVK computation using apiutil.GVKForObject after loading AgentCluster. Updated ownership checks in ensureOwnedClusterDeployment and orphanClusterDeployment to use explicit GroupKind parameter. Added debug logging for ownership mismatches. Imported runtime/schema and apiutil packages.
Controller Tests
controllers/agentcluster_controller_test.go
Updated all IsOwnedByObject calls to include explicit GroupKind parameter with AgentCluster group and kind. Replaced dynamic ownership reference expectations with fixed GVK values in assertions. Added clarifying comment on TypeMeta population behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Unable to retrieve the Ginkgo test file controllers/agentcluster_controller_test.go. The file content is not provided for evaluation. Provide the content of controllers/agentcluster_controller_test.go to enable test structure and quality assessment.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and clearly summarizes the main changes: upgrading CAPI to v1.12.3 and Kubernetes to v1.34, which are the primary dependency upgrades reflected throughout the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed All test declarations across agentcluster_controller_test.go, agentmachine_controller_test.go, and node_provider_id_controller_test.go use stable, deterministic names without dynamic content.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 11, 2026
@CrystalChun
Copy link
Author

/test e2e-ai-operator-ztp-capi

@openshift-ci
Copy link

openshift-ci bot commented Mar 11, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CrystalChun

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 11, 2026

@CrystalChun: This pull request references OCPCLOUD-3407 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Includes additional changes:

  • Util function isOwnedByOjbect now requires the target owner's group version kind passed in as the last argument.
  • GVK additions now that client's GET doesn't return the type Meta for objects

Summary by CodeRabbit

  • Improvements

  • Made controlPlaneEndpoint host and port fields optional for greater flexibility in cluster configuration.

  • Enhanced resource ownership tracking for improved reliability.

  • Chores

  • Updated Kubernetes and Cluster API dependencies to latest patch releases for improved stability and upstream fixes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@CrystalChun
Copy link
Author

/test e2e-ai-operator-ztp-capi

1 similar comment
@CrystalChun
Copy link
Author

/test e2e-ai-operator-ztp-capi

@openshift-ci
Copy link

openshift-ci bot commented Mar 12, 2026

@CrystalChun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ai-operator-ztp-capi 7f2f516 link true /test e2e-ai-operator-ztp-capi

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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